New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow empty, new files to be staged via git checkout -p
#646
Allow empty, new files to be staged via git checkout -p
#646
Conversation
The original patch selection code was written for `git add -p`, and the fundamental unit on which it works is a hunk. We hacked around that to handle deletions back in 24ab81a (add-interactive: handle deletion of empty files, 2009-10-27). But `git add -p` would never see a new file, since we only consider the set of tracked files in the index. However, since the same machinery was used for `git checkout -p` & friends, we can see new files. Handle this case specifically, adding a new prompt for it that is modeled after the `deleted file` case. This also fixes the problem where added _empty_ files could not be staged via `git checkout -p`. Reported-by: Merlin Büge <toni@bluenox07.de> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
00e2673
to
273c78d
Compare
/submit |
Submitted as pull.646.git.1590613746507.gitgitgadget@gmail.com |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This branch is now known as |
This patch series was integrated into pu via git@b240e97. |
On the Git mailing list, Jeff King wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
This patch series was integrated into pu via git@d8bdbce. |
This patch series was integrated into pu via git@ec7bea8. |
This patch series was integrated into next via git@017c325. |
This patch series was integrated into pu via git@1635944. |
This patch series was integrated into pu via git@7101793. |
This patch series was integrated into pu via git@2bdf00e. |
This patch series was integrated into next via git@2bdf00e. |
This patch series was integrated into master via git@2bdf00e. |
Closed via 2bdf00e. |
See https://lore.kernel.org/git/20200527075648.GA4006373@coredump.intra.peff.net for the report.
For ease of backporting, this patch is based on
js/add-p-leftover-bits
.Cc: Merlin Büge toni@bluenox07.de, Jeff King peff@peff.net