git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add a "fix" command to "rebase --interactive"
@ 2009-12-04 14:36 Michael Haggerty
  2009-12-04 14:36 ` [PATCH 1/3] Better document the original repository layout Michael Haggerty
                   ` (5 more replies)
  0 siblings, 6 replies; 32+ messages in thread
From: Michael Haggerty @ 2009-12-04 14:36 UTC (permalink / raw)
  To: git; +Cc: gitster, Johannes.Schindelin, Michael Haggerty

This patch series adds "fix" to the commands that can be used within
the "rebase --interactive" patch editor.  "fix" is like "squash"
except that it discards the log message of the corresponding commit.

Why I would like this feature:

One of my favorite aliases is

    fix = commit --amend -C HEAD

which I use in those all-too-frequent head-slapping "I just committed
something with a minor typo" moments.  It amends the last commit with
whatever is staged, reusing the same commit message.  It can also be
used with the "-a" option, a list of filenames, etc.

But sometimes I don't have my head-slapping moments until a few
commits later.  In this case, my usual practice is to commit the
trivial typo change on top of the current branch, then "rebase
--interactive" to move the typo fix on top of the erroneous commit and
squash it:

pick 05d3b81 Commit with typo
pick c29114a Good commit 1
pick 250b013 Good commit 2
pick 5eb3299 Fix for typo

        |
        V

pick 05d3b81 Commit with typo
squash 5eb3299 Fix for typo
pick c29114a Good commit 1
pick 250b013 Good commit 2

But then it is necessary to go into the commit message editor, move
the cursor down past the first commit message, delete the "Fix for
typo" commit message, save, and quit.

This patch implements a "fix" command, similar to "squash", except
that the corresponding log message is not included in the log message
suggested for the combined commit.  (In fact, it includes the log
message, but commented out.)  It therefore saves the editor chores.

"fix" and "squash" can be used in the same group, in which case the
"squash" commit messages are preserved and the "fix" commit messages
are skipped.

If the idea of a "fix" command is acceptable, then I would like to
implement a further convenience: if a group of commits to be folded
together includes *only* "fix" commits, then the first log message
should be used without even opening an editor.  But I would like to
get a reaction to the "fix" command in general before doing so.

Michael Haggerty (3):
  Better document the original repository layout.
  Set a couple more tags in the original repository.
  Add a command "fix" to rebase --interactive.

 Documentation/git-rebase.txt  |   13 ++++++++-----
 git-rebase--interactive.sh    |   39 +++++++++++++++++++++++++++++----------
 t/lib-rebase.sh               |    7 ++++---
 t/t3404-rebase-interactive.sh |   41 +++++++++++++++++++++++++++++++++++++----
 4 files changed, 78 insertions(+), 22 deletions(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2009-12-09  6:16 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 14:36 [PATCH 0/3] Add a "fix" command to "rebase --interactive" Michael Haggerty
2009-12-04 14:36 ` [PATCH 1/3] Better document the original repository layout Michael Haggerty
2009-12-04 14:52   ` Michael J Gruber
2009-12-04 16:51     ` Johannes Schindelin
2009-12-04 14:36 ` [PATCH 2/3] Set a couple more tags in the original repository Michael Haggerty
2009-12-04 16:52   ` Johannes Schindelin
2009-12-04 14:36 ` [PATCH 3/3] Add a command "fix" to rebase --interactive Michael Haggerty
2009-12-04 16:57   ` Johannes Schindelin
2009-12-04 17:40   ` Junio C Hamano
2009-12-04 17:44     ` Matthieu Moy
2009-12-04 18:44     ` Johannes Schindelin
2009-12-05 18:53       ` Junio C Hamano
2009-12-04 15:13 ` [PATCH 0/3] Add a "fix" command to "rebase --interactive" Michael J Gruber
2009-12-04 17:40   ` Matthieu Moy
2009-12-04 17:44     ` Junio C Hamano
2009-12-04 18:47       ` Johannes Schindelin
2009-12-04 21:27         ` Nanako Shiraishi
2009-12-05  7:39           ` Junio C Hamano
2009-12-08  3:13             ` [PATCH 0/3] Add a "fix" command to "rebase --interactive", [PATCH] rebase -i --autosquash: auto-squash commits Nanako Shiraishi
2009-12-08  3:28               ` [PATCH 0/3] Add a "fix" command to "rebase --interactive" Junio C Hamano
2009-12-08  6:01                 ` Nanako Shiraishi
2009-12-08  7:43                   ` Junio C Hamano
2009-12-08  9:24               ` Junio C Hamano
2009-12-08  9:35                 ` Jeff King
2009-12-08 13:51                   ` Sverre Rabbelier
2009-12-09  3:55                     ` Nanako Shiraishi
2009-12-09  4:41                       ` Aaron Cohen
2009-12-09  6:16                 ` Junio C Hamano
2009-12-08 14:39               ` Matthieu Moy
2009-12-04 15:50 ` Shawn O. Pearce
2009-12-04 22:19 ` Björn Gustavsson
2009-12-04 22:29   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).