From: Junio C Hamano <gitster@pobox.com>
To: Michael Rappazzo <rappazzo@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] git-rebase--interactive.sh: add config option for custom instruction format
Date: Mon, 08 Jun 2015 14:29:13 -0700 [thread overview]
Message-ID: <xmqqioax99ee.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1433797202-97425-2-git-send-email-rappazzo@gmail.com> (Michael Rappazzo's message of "Mon, 8 Jun 2015 17:00:02 -0400")
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>
> ---
> git-rebase--interactive.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index dc3133f..b92375e 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -977,7 +977,9 @@ else
> revisions=$onto...$orig_head
> shortrevisions=$shorthead
> fi
> -git rev-list $merges_option --pretty=oneline --reverse --left-right --topo-order \
> +format=$(git config --get rebase.instructionFormat)
> +# the 'rev-list .. | sed' requires %m to parse; the instruction requires %H to parse
> +git rev-list $merges_option --format="%m%H ${format-%s}" --reverse --left-right --topo-order \
> $revisions ${restrict_revision+^$restrict_revision} | \
> sed -n "s/^>//p" |
> while read -r sha1 rest
Looks OK, but
- Needs a patch to Documentation/config.txt and possibly also
Documentation/git-rebase.txt
- Needs tests somewhere in t34?? series.
Also I think "git rev-list" line has got way too long. As it is
already using backslash-continuation, do not hesitate to fold it
further, e.g.
git rev-list $merges_option --format="%m%H ${format-%s}" \
--reverse --left-right --topo-order \
$revisions ${restrict_revision+^$restrict_revision} | \
sed -n "s/^>//p" |
while ...
Thanks.
next prev parent reply other threads:[~2015-06-08 21:29 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 [this message]
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
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=xmqqioax99ee.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 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.