From: Junio C Hamano <gitster@pobox.com>
To: Mike Rappazzo <rappazzo@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] git-rebase--interactive.sh: add config option for custom
Date: Mon, 08 Jun 2015 10:29:58 -0700 [thread overview]
Message-ID: <xmqqtwuiaz1l.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CANoM8SXM=gk9jpi7PJQh6dVeg=Nbg9bJD0eoU=Y-76vHBsHjcw@mail.gmail.com> (Mike Rappazzo's message of "Mon, 8 Jun 2015 12:01:26 -0400")
Mike Rappazzo <rappazzo@gmail.com> writes:
> On Mon, Jun 8, 2015 at 11:28 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> This is optional, but I still wonder why the command line cannot be
>> more like this, though:
>>
>> format=$(git config --get rebase.insnFormat)
>> git log --format="%H ${format-%s}" --reverse --right-only --topo-order \
>> $revisions ${restrict_revision+^$restrict_revision} |
>> while read -r sha1 junk
>> do
>> ...
>>
>> That way we can optimize one "sed" process away.
>>
>> If this is a good idea, it needs to be a separate follow-up patch
>> that changes "%m filtered by sed" to "use --right-only". I do not
>> think such a change breaks anything, but I do not deal with complex
>> histories myself, so...
>
> As far as I can tell, the rev-list will return multiple lines when not
> using 'oneline'. The 'sed -n' will join the lines back together.
There is no joining going on.
To "rev-list", a custom --pretty/--format is a signal to trigger its
"verbose" mode, and it shows a "commit <object-name>" line and then
the line in the format specified, e.g.
$ git rev-list --pretty='%m%H %<(35,trunc)%s' --right-only --reverse ...2024d3
commit 1e9676ec0a771de06abca3009eb4bdc5a4ae3312
>1e9676ec0a771de06abca3009eb4bdc5a4ae3312 lockfile: replace random() by ran..
commit 2024d3176536fd437b4c0a744161e96bc150a24e
>2024d3176536fd437b4c0a744161e96bc150a24e help.c: wrap wait-only poll() inv..
...
Because of that, "format=%m | sed -n s/>//p" would be one way to
make sure that all lines we care about are prefixed by '>' so that
we can pick them while discarding anything else. So you do need
filtering unless switch to "log", even if you used --right-only.
That is why I didn't use "rev-list" in the message you are
responding to.
prev parent reply other threads:[~2015-06-08 17:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 0:53 [PATCH] git-rebase--interactive.sh: add config option for custom Michael Rappazzo
2015-06-08 15:28 ` Junio C Hamano
2015-06-08 16:01 ` Mike Rappazzo
2015-06-08 17:29 ` Junio C Hamano [this message]
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=xmqqtwuiaz1l.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--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