From: Andy Kitchen <kitchen.andy@gmail•com>
To: git@vger•kernel.org
Cc: "Junio C Hamano" <gitster@pobox•com>,
"Carlos Martín Nieto" <cmn@elego•de>
Subject: Re: git rebase -f --autosquash
Date: Sat, 26 May 2012 17:30:21 +1000 [thread overview]
Message-ID: <33DF11B90FEF4CB6B4103BE0AAF9B256@gmail.com> (raw)
In-Reply-To: <7vipfyiuv6.fsf@alter.siamese.dyndns.org>
On Tuesday, 15 May 2012 at 2:35 AM, Junio C Hamano wrote:
> Given "EDITOR=: git commit args..." and "EDITOR=: git merge args..." are
> equivalent to giving "--no-edit" option to these commands, I would imagine
> "git rebase opts... --no-editor args..." would not be such a stretch.
I agree. However, I think it would be more intuitive to make --autosquash
work with -f or even just on its own in non-interactive mode.
It definitely makes sense practically and semantically to autosquash
non-interactively. Otherwise one needs to activate interactive mode
and effectively disable it in the same command which is a bit esoteric.
I am of the opinion that autosquashing is such a useful feature,
it's even worth having a separate command:
$ git fix
For generally rebuilding commits based on directives
placed in commit messages. Especially because it integrates
nicely with `git commit --fixup' as a kind of super amend. While
this can be easily added with a bit of customisation, I think
that it is generally applicable and useful enough to warrant being
a default part of git.
In summary, I propose:
1a)
$ git rebase -f --autosquash <base>
is made to be effectively equivalent to:
$ EDITOR=: git rebase -i --autosquash <base>
1b)
$ git rebase --autosquash <base>
(i.e. -f is implicit) is made to be effectively equivalent to:
$ EDITOR=: git rebase -i --autosquash <base>
3) A new command is created, for example one of:
$ git fix
$ git squash
$ git autosquash
For preening commits before pushing them upstream.
The default base for these operations would be HEAD@{upstream}
A config option could also be added to warn the user before pushing
commits with messages of the form /^fixup!/ etc.
It could also be less ad-hoc in its operation than --autosquash
currently is. For example, `git commit --fixup' could note the intended
target for the fix allowing `git fix' to operate correctly even when two
commits share the same message.
Of course as with any polite feature request, I am happy to write the
appropriate code, however not being familiar with the git code-base,
I would require some guidance.
Thank you for your time, suggestions welcomed
AK
next prev parent reply other threads:[~2012-05-26 7:30 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
2012-05-14 16:35 ` Junio C Hamano
2012-05-26 7:30 ` Andy Kitchen [this message]
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=33DF11B90FEF4CB6B4103BE0AAF9B256@gmail.com \
--to=kitchen.andy@gmail$(echo .)com \
--cc=cmn@elego$(echo .)de \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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