From: Junio C Hamano <gitster@pobox.com>
To: Mike Rappazzo <rappazzo@gmail.com>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
Git List <git@vger.kernel.org>
Subject: Re: [PATCH v2] git-rebase--interactive.sh: add config option for custom instruction format
Date: Tue, 09 Jun 2015 17:44:47 -0700 [thread overview]
Message-ID: <xmqqwpzcv1c0.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CANoM8SVXmYJn7wbxcPuBSUa-X8v0nggpv_vC8LtPgaBwMtP0HQ@mail.gmail.com> (Mike Rappazzo's message of "Tue, 9 Jun 2015 15:38:54 -0400")
Mike Rappazzo <rappazzo@gmail.com> writes:
> I have since reworked this script to support the short hash in the
> custom format as a special case:
I thought that we always give short form when presenting it to the
end user to edit, but for internal bookkeeping purposes we make sure
that we use the full SHA-1, so that new objects created during the
rebase session will not cause "used to be unique but not anymore"
ambiguity in the commit object names in the instruction sheet.
I have been assuming that the "rev-list" we have been mucking with
was to prepare the latter, the internal bookkeeping data, which must
always spell 40-hex (that is why the default "oneline" is not
"--oneline" but "--pretty=oneline).
Why is it necessary to make %m%H part customizable in the first
place?
Puzzled....
>
> -git rev-list $merges_option --pretty=oneline --reverse --left-right
> --topo-order \
> +format=$(git config --get rebase.instructionFormat)
> +no_format=$?
> +if test ${no_format} -ne 0
> +then
> + format="%H %s"
> +elif test "${format:0:3}" != "%H " && test "${format:0:3}" != "%h "
Do not use bash-ism "substring".
> +then
> + format="%H ${format}"
> +fi
> +# the 'rev-list .. | sed' requires %m to parse; the instruction
> requires %H to parse
> +git rev-list $merges_option --format="%m${format}" \
> + --reverse --left-right --topo-order \
>
> I also use the $no_format variable later on in the autosquash
> re-ordering, and have the tests passing. I want to add some new tests
> on the custom format, and will send a new patch when that is complete.
>
> On Tue, Jun 9, 2015 at 3:23 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>>
>>> Besides, are you sure you don't want to substitute an empty
>>> rebase.instructionFormat' by '%s'? I would have expected to read
>>> ${format:-%s}` (note the colon), but then, this was Junio's
>>> suggestion...
>>
>> That was me simply being sloppy myself, expecting people not to copy
>> and paste literally without thinking. Thanks for noticing.
next prev parent reply other threads:[~2015-06-10 0:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 21:00 [PATCH v2] git-rebase--interactive.sh: add config option for custom instruction format Michael Rappazzo
2015-06-08 21:00 ` Michael Rappazzo
2015-06-08 21:29 ` Junio C Hamano
2015-06-09 9:36 ` Johannes Schindelin
2015-06-09 10:26 ` Mike Rappazzo
2015-06-09 19:23 ` Junio C Hamano
2015-06-09 19:38 ` Mike Rappazzo
2015-06-10 0:44 ` Junio C Hamano [this message]
2015-06-08 22:17 ` 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=xmqqwpzcv1c0.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=rappazzo@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