All of lore.kernel.org
 help / color / mirror / Atom feed
* enhance git-add to avoid password being staged or committed?
@ 2017-02-15 14:36 ryenus
  2017-02-15 21:26 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: ryenus @ 2017-02-15 14:36 UTC (permalink / raw)
  To: Git mailing list

This can be an optional feature, once enabled, git-add would check the
hunk(s) to stage for sensitive information, such as passwords, secret
tokens, then ask the user for confirmation.

The implementation for secret detection could be regexp pattern(s),
and/or (trusted?) commands

Alternative solutions might be hooks during commit, push or recieve,
but it should be the best to do this in the first place during git-add.

The context of this is the following HN discussion about passwords on
GitHub: https://news.ycombinator.com/item?id=13650818

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: enhance git-add to avoid password being staged or committed?
  2017-02-15 14:36 enhance git-add to avoid password being staged or committed? ryenus
@ 2017-02-15 21:26 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2017-02-15 21:26 UTC (permalink / raw)
  To: ryenus; +Cc: Git mailing list

On Wed, Feb 15, 2017 at 10:36:32PM +0800, ryenus wrote:

> This can be an optional feature, once enabled, git-add would check the
> hunk(s) to stage for sensitive information, such as passwords, secret
> tokens, then ask the user for confirmation.
> 
> The implementation for secret detection could be regexp pattern(s),
> and/or (trusted?) commands
> 
> Alternative solutions might be hooks during commit, push or recieve,
> but it should be the best to do this in the first place during git-add.

There are already hooks for commit and receive to catch things locally
and at publishing time, respectively. It's possible that an "add" hook
could be more useful, but I'd be a lot more convinced if people were
actively doing secret-detection in their commit hooks and had some
specific complaint that could be addressed by having an "add" hook.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-15 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 14:36 enhance git-add to avoid password being staged or committed? ryenus
2017-02-15 21:26 ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.