All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rappazzo <rappazzo@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH v4] git-rebase--interactive.sh: add config option for custom instruction format
Date: Fri, 12 Jun 2015 17:12:39 -0400	[thread overview]
Message-ID: <CANoM8SW-N6_yJ0kgGDuGWB+RS-0d54D4FtaRbKqhsf0_fSeMdw@mail.gmail.com> (raw)
In-Reply-To: <xmqqa8w4d4sc.fsf@gitster.dls.corp.google.com>

It only needs the '%s' for the autosquash when the todo/instruction
list order is determined.  For this, in the rearrange_squash function,
it will re-calculate the message:

+               test -z "${format}" || message=$(git log -n 1
--format="%s" ${sha1})

Additionally, it may also rerun the log command when preparing the final list.

It is possible that this could be made more efficient by separating
the list arrangement from the list presentation.  I can look into that
for a future patch.

I did add a test which uses the instructionFormat config, and then
interactively auto-squashes using both a 'squash! <sha1>' and a
'squash! <comment>'. in the commits.


On Fri, Jun 12, 2015 at 4:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Michael Rappazzo <rappazzo@gmail.com> writes:
>
>> A config option 'rebase.instructionFormat' can override the
>> default 'oneline' format of the rebase instruction list.
>>
>> Since the list is parsed using the left, right or boundary mark plus
>> the sha1, they are prepended to the instruction format.
>>
>> Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
>> ---
>>  Documentation/git-rebase.txt |  7 +++++++
>>  git-rebase--interactive.sh   | 20 +++++++++++++++++---
>>  t/t3415-rebase-autosquash.sh | 21 +++++++++++++++++++++
>>  3 files changed, 45 insertions(+), 3 deletions(-)
>
> Thanks, will replace.
>
> The autosquash part somehow makes me feel uneasy, though.  The
> feature fundamentally has to have %s as the first thing in the
> format to work, but by making the format overridable, you are
> potentially breaking that feature, aren't you?

  reply	other threads:[~2015-06-12 21:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12  2:23 [PATCH v4] git-rebase--interactive.sh: add config option for custom instruction format Michael Rappazzo
2015-06-12  2:23 ` Michael Rappazzo
2015-06-12 20:56   ` Junio C Hamano
2015-06-12 21:12     ` Mike Rappazzo [this message]
2015-06-12 22:05       ` Junio C Hamano
2015-06-12 22:15         ` Mike Rappazzo
2015-06-12 22:36           ` 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=CANoM8SW-N6_yJ0kgGDuGWB+RS-0d54D4FtaRbKqhsf0_fSeMdw@mail.gmail.com \
    --to=rappazzo@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.