From: Chris Packham <judge.packham@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Michal Sojka <sojka@os.inf.tu-dresden.de>,
git@vger.kernel.org, paulus@samba.org
Subject: Re: [PATCH RFC] gitk: Allow commit editing
Date: Fri, 19 Aug 2011 23:44:04 +1200 [thread overview]
Message-ID: <4E4E4C84.4030804@gmail.com> (raw)
In-Reply-To: <20110818223346.GA8481@sigill.intra.peff.net>
Hi,
On 19/08/11 10:33, Jeff King wrote:
> On Wed, Aug 17, 2011 at 09:56:11PM +0200, Michal Sojka wrote:
>
>> Hi, this is a proof of concept patch that allows editing of commits
>> from gitk. I often review patches before pushing in gitk and if I
>> would like to have an easy way of fixing typos in commit messages etc.
I've often _thought_ that I wanted something like this. As you say
firing up gitk to review the patch you're about to send (or commit
you're about to push) is probably a fairly common workflow.
>>
>> So the patch adds "Edit this commit" item to gitk's context menu and
>> the actual editing is done by non-interactively invoking interactive
>> rebase :-) and git gui.
>
> Invoking rebase behind the scenes makes me very nervous. In particular:
>
> 1. There is nothing to indicate to the user that they are rewriting a
> string of commits, which is going to wreak havoc if any of the
> commits have been published elsewhere (either pushed somewhere, or
> even present in another local branch). I.e., rebasing generally
> needs to be a conscious decision of the user.
>
> Yes, a veteran user who thinks about it will realize there is no
> way to edit an old commit without rebasing, but I suspect relying
> on that is not enough. There should probably be a prominent
> warning at least the first time somebody uses this feature.
>
> 2. Even if you accept the hazard of rewriting commits, you don't pass
> "-p" to rebase. So it will linearize your history. I don't know how
> robust "-p" is these days, and if it's up to the challenge of
> people using it to rebase potentially large segments of complex
> history.
>
> So I think your idea is sane, and if you use it appropriately (by
> editing commits in recent-ish linear stretches of history) your patch
> works fine. But I really worry that it is going to be a problem for less
> clueful users to stumble across in the menu.
>
> -Peff
And as Peff points out there are some major caveats about how far back
you would want to let people edit. I suspect you could come up with some
sane rules (e.g. only allow editing the last commit, the last N commits,
only commits that are not present in remote X). Whatever rules you come
up with to protect people I think you'll end up frustrating them as well
(why can I edit this commit but not that one).
One thing I've thought about (but don't know enough TCL to begin to
implement) is a graphical rebase front end. I often use git gui to make
tweaks to the last commit (message and content) so why not extend that
to a rebase operation. I think that might address some of Peffs concerns
because the user would be invoking something specifically intended for
rebasing and accepts all the caveats that go along with that.
Anyway that's my 2c
--
Chris
next prev parent reply other threads:[~2011-08-19 11:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 19:56 [PATCH RFC] gitk: Allow commit editing Michal Sojka
2011-08-18 22:33 ` Jeff King
2011-08-19 11:44 ` Chris Packham [this message]
2011-08-19 13:34 ` Michal Sojka
2011-08-19 14:40 ` Michal Sojka
2011-08-19 12:23 ` Michal Sojka
2011-08-19 12:25 ` [PATCH] " Michal Sojka
2011-08-25 3:14 ` Jeff King
2011-08-25 13:15 ` [PATCH v3] " Michal Sojka
2011-08-25 17:30 ` Jeff King
2011-08-27 12:31 ` [PATCH v4] " Michal Sojka
2011-09-07 20:10 ` Jeff King
2011-09-08 20:59 ` Paul Mackerras
2011-09-13 23:11 ` Michal Sojka
2011-08-25 3:07 ` [PATCH RFC] " Jeff King
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=4E4E4C84.4030804@gmail.com \
--to=judge.packham@gmail.com \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
--cc=peff@peff.net \
--cc=sojka@os.inf.tu-dresden.de \
/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).