Thread (37 messages) flat view 37 messages, 12 authors, 2016-06-15

Re: git diff --added (Re: Command-line interface thoughts)

From: Miles Bader <hidden>
Date: 2016-06-15 22:51:28

Possibly related (same subject, not in this thread)

On Mon, Jun 13, 2011 at 4:11 AM, Miles Bader [off-list ref] wrote:
quoted
Do you think it would be valuable to introduce --added as a synonym
for --cached and slowly steer documentation to encourage the latter
in place of the former?
"--added" sounds very awkward though; "--staged" is much more natural.
I should note _why_ this is so:

The main problem is well-known -- that "git add" is a bit overloaded
and slightly awkward in some case (e.g., to remove a file, you need to
add it...).  But whatever, it works well enough, because people are
used to it.

However in the case of git diff, if one sees "git diff --added", it
sounds like it means "show me a diff of added files" -- but the term
"added files" is ambiguous; and the fact that "git add" is in fact,
overloaded with multiple meanings doesn't really help, the basic
ambiguity makes "git diff --added" awkward and unclear.

A far better way would be to (1) make "git diff --staged" an alias for
"git-diff --cached" (2) start promoting "git stage" in documentation,
instead of "git add".

-Miles

-- 
Cat is power.  Cat is peace.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help