You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using git add --patch commit-comments from outside the current patch are added to the commit message and all commit tags are removed, not just those from the current patch.
For example, say I have the following diff of a file in my repo:
#! /usr/bin/env python
+#@commit greeting alice
+print("Hi Alice")
+
print("Hello World")
+
+#@commit say goodbye
+print("Goodbye World")
I add the first hunk using git add --patch, but ignore the second hunk.
The commit message I get is:
- [test.py#3] greeting alice
- [test.py#8] say goodbye
And after removing the commit-comments the file looks like:
I will make a pull request for this right away. Having not heavily used git add --patch myself, I appreciate the detail and correct output you provided.
The overarching plan was to use git diff --cached --name-status --diff-filter=ACM to only inspect Added, Created, or Modified files. However, that doesn't resolve the --patch issue.
When using
git add --patch
commit-comments from outside the current patch are added to the commit message and all commit tags are removed, not just those from the current patch.For example, say I have the following diff of a file in my repo:
I add the first hunk using
git add --patch
, but ignore the second hunk.The commit message I get is:
And after removing the commit-comments the file looks like:
The correct behaviour should be for the commit message to be:
And the file to be:
(Loving the tool by-the-way!)
The text was updated successfully, but these errors were encountered: