[PATCH] git-fixup: automatically create a fixup commit
Sometimes I get a broken patch, apply it and then need to fix it up. git
commit --fixup is perfect for this, but makes me look up the commit that
created the breakage manually. git-fixup is a tool to speed this up.
Several heuristics would be reasonable for locating the problematic
1. look up the last commit that touched the
file(s) affected by the fixup
2. look up the last commit that touched the
line(s) affected by the fixup
this implements the first heuristic.
Signed-off-by: Michael S. Tsirkin <[hidden email]>
contrib/git-fixup | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100755 contrib/git-fixup
diff --git a/contrib/git-fixup b/contrib/git-fixup
new file mode 100755
@@ -0,0 +1,8 @@
+ git diff --cached --quiet
+ echo "Nothing to commit!"
+ exit 1
+ git commit --fixup=$(git log --pretty=format:%H -1 $(git diff --cached --name-only)) "$@"
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email] More majordomo info at http://vger.kernel.org/majordomo-info.html