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

Problem with "stgit show"

From
Yann Dirson <ydirson@altern.org>
Date
Jun 28, 2007, 20:51 UTC
Message-ID
<20070628205154.GI7730@nan92-1-81-57-214-146.fbx.proxad.net>

While investigating bug #8453 (https://gna.org/bugs/?8453) I looked for the 1st time at how "stg show" is implemented, and it looks like this and a couple of related parts of the code need some refactoring.

The problem is, "stg show a@b" and "stg show a@b z@b" trigger different code paths. The problem with the latter is that, having more than one arg, it gets feed through parse_patches(), which is only designed to deal with patches in a single stack, and rejects "a@b" as not a member of the current stack.

The single-arg form, at the opposite, falls into the branch designed to emulate "git show" by allowing git refs not otherwise meaningful to stgit. That is, "stg show a@b" seems to only work as a side-effect.

The same difference in handling single-arg from multiple-arg will similarly cause non-stgit refs to be invalid when not given alone (ie. "stg show origin/master" works, but "stg show origin/master patch1" fails with "Unknown patch name: origin/master".

Since the different handling of len(args)==1 results in inconsistencies, IMHO we should get rid of it. Now adding support for out-of-this-stack refs to parse_patches() would require a total rewrite thereof, so I suggest we leave this for another round.

Non-stgit refs should IMHO be dropped. Catalin, you mentionned consistency with "stg pick" IIRC, but "pick" only ever takes a single arg, so the commands are clearly too different. We always have git-show anyway if we want to look at them.

For patches on other branches, we could simply add the common --branch flag to "stg show". That would not allow to get patches from different stacks in a single run, and it's a bit more verbose than the @ syntax for a single patch, but well, that could make sense for 0.13.

I'll send out a couple of patchlets for this.
-- 
Yann
Message 1 of 1 in “Problem with "stgit show"”
  1. Yann DirsonJun 28, 2007

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.