git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Mike Rappazzo <rappazzo@gmail.com>
Date
Jun 9, 2015, 19:38 UTC
Message-ID
<CANoM8SVXmYJn7wbxcPuBSUa-X8v0nggpv_vC8LtPgaBwMtP0HQ@mail.gmail.com>
In-Reply-To
<xmqqmw0865zk.fsf@gitster.dls.corp.google.com>

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 <gitster@pobox.com> wrote:
Show 9 quoted lines
> 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.
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 9 in “git-rebase--interactive.sh: add config option for custom instruction format”
  1. git-rebase--interactive.sh: add config option for custom instruction formatMichael Rappazzo, Jun 8, 2015
  2. git-rebase--interactive.sh: add config option for custom instruction formatMichael Rappazzo, Jun 8, 2015
  3. Junio C HamanoJun 8, 2015
  4. Johannes SchindelinJun 9, 2015
  5. Mike RappazzoJun 9, 2015
  6. Junio C HamanoJun 9, 2015
  7. Mike RappazzoJun 9, 2015
  8. Junio C HamanoJun 10, 2015
  9. Junio C HamanoJun 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.