git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
	Git List <git@vger.kernel.org>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Jeff King <peff@peff.net>, Philip Oakley <philipoakley@iee.org>
Subject: Re: [PATCH 3/3] rebase: new convenient option to edit a single commit
Date: Tue, 4 Mar 2014 17:24:49 +0700	[thread overview]
Message-ID: <CACsJy8CSaAnVrFnhxRd=jPmXCat5AObNRLKzCesbdx3JS83PnA@mail.gmail.com> (raw)
In-Reply-To: <53159601.8020702@alum.mit.edu>

On Tue, Mar 4, 2014 at 3:59 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
>> On Tue, Mar 4, 2014 at 3:28 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>>> Is it correct to single out only "edit" for special treatment? If
>>> allowing "edit" on the command-line, then shouldn't command-line
>>> "reword" also be supported? I, for one, often need to reword a commit
>>> message (or two or three); far more frequently than I need to edit a
>>> commit.
>>>
>>> (This is a genuine question about perceived favoritism of "edit", as
>>> opposed to a request to further bloat the interface.)
>>
>> Heh I had the same thought yesterday. The same thing could be asked
>> for "git commit --fixup" to send us back to the fixed up commit so we
>> can do something about it. If we go along that line, then "git commit"
>> may be a better interface to reword older commits..
>
> I disagree.  "git commit --fixup" doesn't rewrite history.  It just adds
> a new commit with a special commit message that will make it easier to
> rewrite history later.  I think it would be prudent to keep the
> history-rewriting functionality segregated in "git rebase", which users
> already know they have to use with care [1].

Just to be clear I didn't mean to modify --fixup behavior. It could be
--amend-old-commit or something like that. It's actually --amend that
made me want to put the UI in "git commit". But it's a bad idea
(besides what you pointed out) because after you're done, you still
need to do "git rebase --continue".

> But the next question is whether "git rebase" should have shortcuts for
> *most* of its line commands.  All of the following seem to make sense:
>
>     git rebase --edit COMMIT
>
>         A long-form for the -e option we have been talking about.
>         It is unfortunately that this spelling sounds like the
>         "--edit" option on "git commit --edit" and "git merge --edit",
>         so people might use it when they really mean
>         "git rebase --reword COMMIT".
>
>     git rebase --reword COMMIT

Sounds good.

>     git rebase --fixup COMMIT
>     git rebase --squash COMMIT

This is not interactive (except when merge conflicts occur), is it?

A bit off topic. I sometimes want to fix up a commit and make it stop
there for me to test it again but there is no such command, is there?
Maybe we could add support for "fixup/edit" (or "fe" for short) and
"squash/edit" ("se"). Not really familiar with the code base to do
that myself quickly though.

>     git rebase --kill COMMIT
>
>         Remove the commit from history, like running "git rebase
>         --interactive" then deleting that line.

Yes! Done this sometimes (not so often) but a definitely nice thing to
have. I'd go with --remove or --delete though.
-- 
Duy

  reply	other threads:[~2014-03-04 10:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 13:01 [PATCH/RFC] rebase: new convenient option to edit a single commit Nguyễn Thái Ngọc Duy
2014-02-27 13:52 ` Matthieu Moy
2014-02-28  6:58 ` Jeff King
2014-02-28  7:34   ` Duy Nguyen
2014-02-28  7:38     ` Jeff King
2014-02-28 17:14   ` Philip Oakley
2014-03-02  2:53 ` [PATCH 0/3] rebase's convenient options Nguyễn Thái Ngọc Duy
2014-03-02  2:53   ` [PATCH 1/3] rev-parse: support OPT_NUMBER_CALLBACK in --parseopt Nguyễn Thái Ngọc Duy
2014-03-04 18:28     ` Junio C Hamano
2014-03-02  2:53   ` [PATCH 2/3] rebase: accept -<number> as another way of saying HEAD~<number> Nguyễn Thái Ngọc Duy
2014-03-02  8:37     ` Eric Sunshine
2014-03-02  8:45       ` Duy Nguyen
2014-03-02  8:53     ` Eric Sunshine
2014-03-02  8:55       ` Eric Sunshine
2014-03-02 15:55         ` Matthieu Moy
2014-03-03  9:16           ` Michael Haggerty
2014-03-03  9:37             ` Matthieu Moy
2014-03-03 10:04               ` Duy Nguyen
2014-03-03 10:11                 ` David Kastrup
2014-03-03 10:12                 ` Matthieu Moy
2014-03-03 10:13               ` Jeff King
2014-03-03 21:48               ` Junio C Hamano
2014-03-03 22:39                 ` Matthieu Moy
2014-03-03 21:44             ` Junio C Hamano
2014-03-02  2:53   ` [PATCH 3/3] rebase: new convenient option to edit a single commit Nguyễn Thái Ngọc Duy
2014-03-02  9:04     ` Eric Sunshine
2014-03-02  9:09       ` Eric Sunshine
2014-03-03 10:10         ` Michael Haggerty
2014-03-03 10:15           ` Duy Nguyen
2014-03-03 10:37             ` David Kastrup
2014-03-03 20:28     ` Eric Sunshine
2014-03-04  2:08       ` Duy Nguyen
2014-03-04  8:59         ` Michael Haggerty
2014-03-04 10:24           ` Duy Nguyen [this message]
2014-03-04 13:11             ` Michael Haggerty
2014-03-04 18:37           ` Junio C Hamano
2014-03-09  2:49           ` [PATCH/RFC] rebase: new convenient option to edit/reword/delete " Nguyễn Thái Ngọc Duy
2014-03-09 16:30             ` Matthieu Moy
2014-03-10  8:30             ` Michael Haggerty
2014-03-10  8:41               ` Matthieu Moy

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACsJy8CSaAnVrFnhxRd=jPmXCat5AObNRLKzCesbdx3JS83PnA@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.org \
    --cc=sunshine@sunshineco.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).