Re: [PATCH v2] git-rebase--interactive.sh: add config option for custom instruction format

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2] git-rebase--interactive.sh: add config option for custom instruction format

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:14

Johannes Schindelin [off-list ref] 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.

Re: [PATCH v2] git-rebase--interactive.sh: add config option for custom instruction format

From: Mike Rappazzo <hidden>
Date: 2016-06-15 23:05:14

I have since reworked this script to support the short hash in the
custom format as a special case:

-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 "
+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 [off-list ref] wrote:
Johannes Schindelin [off-list ref] writes:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help