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

Re: [StGIT RFC] Changing patch@branch syntax

From
Yann Dirson <ydirson@altern.org>
Date
Jun 21, 2007, 23:02 UTC
Message-ID
<20070621230207.GD7730@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<20070522210020.GV19253@nan92-1-81-57-214-146.fbx.proxad.net>

Working in the implementation of hydras/pools, as well as discussing of their future, led me to the following thoughts, quite related to how we should select a new syntax for patches.

First, as a foreword, a bit if refactoring: I think we should use some sort of Stackable (maybe pick a better name) class as a parent for Patch and PatchSet. Instances of a Stackable would be candidates to be members of a PatchSet. That means we can have stacks within a stack, as well as stacks members of a pool. But we also need a syntax to name stacks-(in-a-stack)*, and patches within them.

Second, but not least, we currently have an ambiguity in syntax: "foo" can mean "patch foo in current branch" or "branch foo", depending on the context, and that is *really* bad. What's more, my former proposal (quoted below) does not improve this issue. And my previous proposal, which suggested using a prefix like "/stack/patch" for a fully qualified patch and "patch" for a relative one does not solve that problem either, and brings the additional annoyance of introducing a syntax that is incompatible with git-core.

So here is a new proposal, which I believe would address all current issues, at the expense of changing stgit syntax. The idea is to use a single separator for all levels of Stackable objects, with an optional "patch id" (eg. //top) at the end when meaningful. Only names would be possible to omit, separators would be mandatory to specify the nesting level. That gives a syntax of:

	[patchset]([:stackable]+(//id)?)*
Examples:
	<stack>			the named branch (git-compatible)
	<stack>:<patch>		named patch in named stack
	:<patch>		named patch in current patchset (currently just "<patch>")
	<stack>:		current (top) patch in named patchset
	<pool>:<stack>:<patch>	fully-qualified patch in a named hydra
	::			top patch of the current stack of an hydra
	:<stack>://bottom.old	previous bottom of the top patch in the named stack of current pool
How does that feel ?
On Tue, May 22, 2007 at 11:00:20PM +0200, Yann Dirson wrote:
Show 18 quoted lines
> Following the "stg pick" example above, would we also want to allow
> picking from a remote repo ?  Then the URL fragment notation could be
> suited, and we could have something like:
> 
> 	http://full/path/to/repo#my/branch:my/patch//top
> 
> That is, a formal syntax of:
> 
> 	[[[repo#]branch:]patch][//modifier]
> 
> Going further, since specifying a repo without a branch probably has
> no meaning (unless we want to default to the HEAD branch), we could
> simplify to the following:
> 
> 	[[[repo#]branch#]patch][//modifier]
> 
> I don't think we really want to allow "repo#patch", meaning that patch
> on the current branch, as this gets easily confused by branch switching.
Previous: Yann DirsonNext: Catalin Marinas
Message 5 of 12 in “[StGIT RFC] Changing patch@branch syntax”
  1. Yann DirsonMay 15, 2007
  2. Karl HasselströmMay 16, 2007
  3. Catalin MarinasMay 22, 2007
  4. Yann DirsonMay 22, 2007
  5. Yann DirsonJun 21, 2007
  6. Catalin MarinasJun 22, 2007
  7. Yann DirsonJun 22, 2007
  8. Catalin MarinasJun 22, 2007
  9. Yann DirsonJun 24, 2007
  10. Catalin MarinasJun 25, 2007
  11. Yann DirsonJun 26, 2007
  12. Yann DirsonJul 6, 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.