Re: BUG: `git commit` adding unstaged chunks of files to commits on 2.33.0

3 messages, 2 authors, 2021-08-31 · open the first message on its own page

Re: BUG: `git commit` adding unstaged chunks of files to commits on 2.33.0

From: Junio C Hamano <hidden>
Date: 2021-08-31 17:56:51

Andrew Thorp [off-list ref] writes:
quoted
What did you do before the bug happened? (Steps to reproduce your issue)
Edit a checked-in file, adding multiple chunks of lines to the file.
Using `git add -p <file>`, stage one of the chunks, leave some chunks unstaged.
After running `git status` the file should both in the section
`Changes to be committed:` and `Changes not staged for commit`.
Commit the changes.
How was the last "commit the changes" done exactly?  

If either "git commit -a" or "git commit <file>" was done, that
would explain the symptom of having the entire up-to-date contents
of <file> in the working tree recorded in the resulting commit.  The
former tells "take all changes in the working tree", the latter
tells "take the version of <file> in the working tree as a whole",
to Git to create a commit out of.

"git commit" without pathspec would have made a partial commit that
records only the changes that were added with "git add -p" to the
index, though.

Re: BUG: `git commit` adding unstaged chunks of files to commits on 2.33.0

From: Andrew Thorp <hidden>
Date: 2021-08-31 18:01:27

How was the last "commit the changes" done exactly?
So far I have confirmed this error occurs when running `git commit -m "foo"`,
`git commit`, and `git commit --amend`.

Re: BUG: `git commit` adding unstaged chunks of files to commits on 2.33.0

From: Andrew Thorp <hidden>
Date: 2021-08-31 18:02:14

git commit" without pathspec would have made a partial commit that
records only the changes that were added with "git add -p" to the
index, though.

Yeah, that was the expected behavior, but not what I experienced.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help