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

[RFC PATCH] An option parser for the sequencer

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jul 9, 2011, 15:41 UTC
Message-ID
<1310226118-10201-1-git-send-email-artagnon@gmail.com>
Hi,

I've decided not to support arbitrary command-line options in the instruction sheet. A typical instruction sheet will looks like this (inspired heavily by the rebase -i instruction sheet format):

pick 3b36854 t: add tests for cloning remotes with detached HEAD pick 61adfd3 consider only branches in guess_remote_head pick 8537f0e submodule add: test failure when url is not configured in superproject pick 4d68932 submodule add: allow relative repository path even when no url is set pick f22a17e submodule add: clean up duplicated code pick 59a5775 make copy_ref globally available pick c1921c1 clone: always fetch remote HEAD

For persisting one set of options for every "git cherry-pick"/ "git revert" invocation, I've decided to use a simple "key = value" format and put it in .git/sequencer/opts (to sit beside .git/sequencer/head and .git/sequencer/todo). For strategy-option, I thought it would be cute to separate the various options using ' | '. So, it'll look something like this in the end:

signoff = true mainline = 1 strategy-option = recursive | ours

The implementation is a little rough around the edges, but I'm pretty happy with the overall design: it looks like a scaled-down version of parse-options. Quite a lot of context is missing (where did sequencer.h come from?!), but I hope it's clear enough to convey the idea.

Thanks for reading.
Ramkumar Ramachandra (1):
  revert: Persist per-session opts
 builtin/revert.c |  143 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sequencer.h      |    8 +++
 2 files changed, 151 insertions(+), 0 deletions(-)
-- 
1.7.5.GIT
Next: Ramkumar Ramachandra
Message 1 of 6 in “An option parser for the sequencer”
  1. An option parser for the sequencerRamkumar Ramachandra, Jul 9, 2011
  2. revert: Persist per-session optsRamkumar Ramachandra, Jul 9, 2011
  3. Christian CouderJul 10, 2011
  4. Ramkumar RamachandraJul 11, 2011
  5. Christian CouderJul 10, 2011
  6. Ramkumar RamachandraJul 11, 2011

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.