{"thread":{"id":"8766","subject":"Problem with \"stgit show\"","startedAt":"2007-06-28T20:51:54Z","lastAt":"2007-06-28T20:51:54Z","messageCount":1,"participants":["Yann Dirson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"46000","messageId":"20070628205154.GI7730@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"8766","inReplyTo":null,"subject":"Problem with \"stgit show\"","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-06-28T20:51:54Z","receivedAt":"2007-06-28T20:51:54Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"While investigating bug #8453 (https://gna.org/bugs/?8453) I looked\nfor the 1st time at how \"stg show\" is implemented, and it looks like\nthis and a couple of related parts of the code need some refactoring.\n\nThe problem is, \"stg show a@b\" and \"stg show a@b z@b\" trigger\ndifferent code paths.  The problem with the latter is that, having\nmore than one arg, it gets feed through parse_patches(), which is only\ndesigned to deal with patches in a single stack, and rejects \"a@b\"\nas not a member of the current stack.\n\nThe single-arg form, at the opposite, falls into the branch designed\nto emulate \"git show\" by allowing git refs not otherwise meaningful to\nstgit.  That is, \"stg show a@b\" seems to only work as a side-effect.\n\nThe same difference in handling single-arg from multiple-arg will\nsimilarly cause non-stgit refs to be invalid when not given alone\n(ie. \"stg show origin/master\" works, but \"stg show origin/master\npatch1\" fails with \"Unknown patch name: origin/master\".\n\n\nSince the different handling of len(args)==1 results in\ninconsistencies, IMHO we should get rid of it.  Now adding support for\nout-of-this-stack refs to parse_patches() would require a total\nrewrite thereof, so I suggest we leave this for another round.\n\nNon-stgit refs should IMHO be dropped.  Catalin, you mentionned\nconsistency with \"stg pick\" IIRC, but \"pick\" only ever takes a single\narg, so the commands are clearly too different.  We always have\ngit-show anyway if we want to look at them.\n\nFor patches on other branches, we could simply add the common --branch\nflag to \"stg show\".  That would not allow to get patches from\ndifferent stacks in a single run, and it's a bit more verbose than the\n@ syntax for a single patch, but well, that could make sense for 0.13.\n\nI'll send out a couple of patchlets for this.\n-- \nYann\n"}]}