Antw: Surprising semantics of "git add file"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Actually things are worse: When I tried to fix the comment for the unexpected commit at least using "git commit --amend", more files were committed!

>>> Ulrich Windl 05.05.19 22.02 Uhr >>>
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






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux