From: Jeff King <peff@peff.net>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: git discussion list <git@vger.kernel.org>,
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: GSoC idea: allow "git rebase --interactive" todo lines to take options
Date: Wed, 26 Feb 2014 06:42:01 -0500 [thread overview]
Message-ID: <20140226114200.GA3779@sigill.intra.peff.net> (raw)
In-Reply-To: <530DCC83.1060805@alum.mit.edu>
On Wed, Feb 26, 2014 at 12:14:11PM +0100, Michael Haggerty wrote:
> > [1] The one feature I would like in this vein is that editing the title
> > in the instruction-sheet would modify the commit message of the
> > relevant commit. For some reason I try to do this every few weeks,
> > but of course the changes are just thrown away.
>
> Given that commit messages can be more than one line long, a feature
> like this would be confusing, I think, and perhaps subtly encourage
> people to limit their commit messages to a single line, which would be a
> bad thing.
Right, I was assuming it would just modify the subject-line, and leave
the rest intact (I often want to use it to just replace one word or fix
a typo, since I am starting right at it in the insn sheet).
> Plus, until now such edits were thrown away, so there are
> backwards compatibility problems if we suddenly start preserving such edits.
Good point. For true interactive use it probably wouldn't be that big a
deal, but people do weird things with GIT_EDITOR and auto-munging the
list of commits. A heuristic like "is there any message there at all"
might work, as you mentioned, but heuristics make me nervous.
> But using the other ideas discussed here one could do
>
> pick -m "New log message" <sha1>
Yeah, that would work, though you have to retype the whole thing, which
is potentially annoying (clever use of your editor can pull it over from
the other side, but it's not super-friendly).
Something like:
pick --subject <sha1> <modified message...>
would be simpler.
> amend -m "Revised log message"
That would replace the whole message, which I definitely don't want (and
would encourage bad habits).
> Another, more wonkish idea I though of would be
>
> pick --tree=<treeish> <sha1>
>
> to force the tree of the commit to be set to that of the specified
> <treeish> while keeping the commit metadata from <sha1>.
I think there's a large foot-shooting capacity there. Any commit you've
reordered from after the "--tree" to before it will mysteriously get
undone in the "--tree" commit. E.g.:
pick aaaaaaa
pick bbbbbbb
pick ccccccc
being done as:
pick ccccccc
pick bbbbbbb
pick --tree=bbbbbbb aaaaaaa
-Peff
next prev parent reply other threads:[~2014-02-26 11:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 8:04 GSoC idea: allow "git rebase --interactive" todo lines to take options Michael Haggerty
2014-02-26 10:52 ` Jeff King
2014-02-26 11:14 ` Michael Haggerty
2014-02-26 11:42 ` Jeff King [this message]
2014-02-26 14:55 ` Tay Ray Chuan
2014-02-26 19:55 ` Junio C Hamano
2014-02-27 7:48 ` Michael Haggerty
2014-02-27 18:10 ` Brandon McCaig
2014-02-28 12:52 ` Jeff King
2014-02-28 14:03 ` Michael Haggerty
2014-03-11 1:37 ` Jeff King
2014-03-11 19:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140226114200.GA3779@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=martin.von.zweigbergk@gmail.com \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).