From: "Carlos Martín Nieto" <cmn@elego.de>
To: Andy Kitchen <kitchen.andy@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git rebase -f --autosquash
Date: Sat, 12 May 2012 13:05:55 +0200 [thread overview]
Message-ID: <1336820755.3002.11.camel@centaur.lab.cmartin.tk> (raw)
In-Reply-To: <D7BE2BACB49749DB9FC37D4ACCCD008B@gmail.com>
On Sat, 2012-05-12 at 20:38 +1000, Andy Kitchen wrote:
> Hi All,
>
> I commonly use:
>
> git commit --fixup <commit>
>
> to preen commits before pushing them. I can run
>
> git rebase -i --autosquash HEAD@{upstream}
>
> to apply these fixes, however, autosquash only
> applies to interactive rebases.
>
> Because I am sure that my fixes are applicable,
> I would like to be able to non-interactively autosquash, possibly
> like so:
>
> git rebase -f --autosquash HEAD@{upstream}
>
>
> Would anyone else find this feature useful?
If you're confident that an autosquash would produce the right
instructions, you can skip the editor phase by setting the EDITOR
environment variable to something that won't spawn an editor. Popular
variants are 'cat' and ':'. I prefer 'cat' because then I can see the
instruction set in the terminal and verify it's the correct one. You can
also set the rebase.autosquash config variable and then you just have to
type
EDITOR=cat git rebase -i @{u}
or
EDITOR=: git rebase -i @{u}
and maybe set an alias (I have a 'riu' alias for 'rebase -i @{u}').
I'm not saying an extra option wouldn't be useful, but there's already
ways of making git not spawn a text editor which works for all commands,
and you can even make an alias that will do precisely that.
cmn
next prev parent reply other threads:[~2012-05-12 11:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-12 10:38 git rebase -f --autosquash Andy Kitchen
2012-05-12 11:05 ` Carlos Martín Nieto [this message]
2012-05-14 16:35 ` Junio C Hamano
2012-05-26 7:30 ` Andy Kitchen
2012-05-26 12:53 ` Vincent van Ravesteijn
2012-05-27 6:44 ` Junio C Hamano
2012-06-04 19:44 ` Phil Hord
2012-06-04 20:05 ` 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=1336820755.3002.11.camel@centaur.lab.cmartin.tk \
--to=cmn@elego.de \
--cc=git@vger.kernel.org \
--cc=kitchen.andy@gmail.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.
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).