git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Surprising semantics of "git add file"
@ 2019-05-05 20:02 Ulrich Windl
  2019-05-05 20:12 ` Antw: " Ulrich Windl
  2019-05-05 20:31 ` Andreas Schwab
  0 siblings, 2 replies; 4+ messages in thread
From: Ulrich Windl @ 2019-05-05 20:02 UTC (permalink / raw)
  To: git

Hi!

Reading the manual, I realized that "it is the way it is (it works as documented)", but to me it's surprising, meaning: I feel it's wrong:
(git-2.16.4)
I have staged several files, and then I do "git add -interactive file" to add some selected changes from file.
After that a "git diff --cached file" just shows the changes added interactively, but when I "git add file" to commit those changes), even the unstaged changes from file are committed.
I feel this is inconsistent: At least "git diff --cached file" should behave like "git commit file", meaning "git commit file" should be fixed IMHO.
Or are there any reasonable use cased for that?

Regards,
Ulrich Windl




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

end of thread, other threads:[~2019-05-06  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-05 20:02 Surprising semantics of "git add file" Ulrich Windl
2019-05-05 20:12 ` Antw: " Ulrich Windl
2019-05-05 20:31 ` Andreas Schwab
2019-05-06  7:14   ` Antw: " Ulrich Windl

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).