git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Clifford <mr.william.clifford@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH/RFC 1/2] Add sequence.format to interactive rebase
Date: Fri, 5 Sep 2014 01:40:01 -0700	[thread overview]
Message-ID: <861trli9lb.fsf@gmail.com> (raw)

Allow user to customize the format of commit table in interactive
rebase todo file. Short hashes are still required to be the second
column so these are added to the format if not already present.
Defaults to oneline as before.

Signed-off-by: William Clifford <mr.william.clifford@gmail.com>
Signed-off-by: Matthew Boeh <m@mboeh.com>
---
 git-rebase--interactive.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index b64dd28..ba1f4b8 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -961,7 +961,19 @@ else
 	revisions=$onto...$orig_head
 	shortrevisions=$shorthead
 fi
-git rev-list $merges_option --pretty=oneline --abbrev-commit \
+
+if test -z "$GIT_SEQUENCE_FORMAT"
+then
+	GIT_SEQUENCE_FORMAT="$(git config sequence.format)"
+fi
+if test -n "$GIT_SEQUENCE_FORMAT"
+then
+	if test "$GIT_SEQUENCE_FORMAT" = "${GIT_SEQUENCE_FORMAT#>%h}"
+	then
+		GIT_SEQUENCE_FORMAT=">%h $GIT_SEQUENCE_FORMAT"
+	fi
+fi
+git rev-list $merges_option --pretty="${GIT_SEQUENCE_FORMAT:-oneline}" --abbrev-commit \
 	--abbrev=7 --reverse --left-right --topo-order \
 	$revisions ${restrict_revision+^$restrict_revision} | \
 	sed -n "s/^>//p" |
-- 
William Clifford

                 reply	other threads:[~2014-09-09  6:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=861trli9lb.fsf@gmail.com \
    --to=mr.william.clifford@gmail.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).