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

Re: [RFC PATCH] Rename "bury" back to "sink".

From
Yann Dirson <ydirson@altern.org>
Date
May 5, 2007, 20:13 UTC
Message-ID
<20070505201307.GE19253@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<f1gf8i$p52$1@sea.gmane.org>

The whole debate around burying, sinking and floating patches made me think a bit more about this. So we have:

float:		move specified patches to top of stack
bury/float:	move specified patches to bottom of stack or any place
		in the stack identified by a nearby patch

All in all, that all "move specified patches to a specified place". So wouldn't it be possible to end the debate by merging those commands into a single "stg move" command ?

Side note about the "stg move" name: yes it could possible to mistake it for "move file" (especially as we don't have "stg mv"). My current state of mind would be to drop add/rm/cp from stgit, and move the "stg cp" logic to a new git-cp command. This way, stgit would just be about handling series of patches, with git being used for the working-copy. Any opinions on this ?

Now to the new command.  We could have something like:
 stg move -t base <patches>	<=> stg sink <patches>
 stg move -t <patch> <patches>	<=> stg sink -t <patch> <patches>
 stg move -t current <patches>	<=> stg float <patches>

Note the introduction of a new "curent" stg_id for the tip of the stack.

The semantics of the arg to -t would be something like "the limit between the patches that will end up below <patches> and those that will end up above". I suppose "-t current" should be the default, so it may not even be necessary to expose "current" to the command-line.

The "conceptual algorithm" would be:
 1. stg pop <patches>
 2. stg push <patches>
 3. stg goto "where I was"

"-s [<series>]" would be allowed as an alternative to <patches>, so "move" would be a strict superset of "float".

By default, consistently with "float", the <patches> (and hence everything originally under the target point) will end up applied if the target of the move was "within $applied" (ie. an applied patch or "current" - something we could call "below the surface", hi float and sink ;), and all patches that were applied (ie. those between the target and the former tip) will end up being reapplied, consistently with "sink".

If the target point is in $unapplied, then the command will be equivalent to "stg pop <patches>" with those patches reordered at the target (ie. no need to really execute steps 2 and 3 above). That's no rocket science, but a useful I have already missed, eg. when I just want to move the patches away from my working set (nowadays we could hide them, but that may not be always adequate).

A --dont-come-back flag of some sort will skip step 3 of the conceptual algorithm above. When the target will be in $applied, it will be the equivalent of "sink --nopush". When the target is in $unapplied, we will "goto <last of <patches>>" after reorering the unapplied patches. Never missed this one till now, but who knows, this side-effect might come handy.

Opinions ?
-- 
Yann.

PS: this RFC is known as "bury sink and float" ;)
Previous: Jakub NarebskiNext: Karl Hasselström
Message 3 of 8 in “Rename "bury" back to "sink".”
  1. Rename "bury" back to "sink".Yann Dirson, May 4, 2007
  2. Jakub NarebskiMay 4, 2007
  3. Yann DirsonMay 5, 2007
  4. Karl HasselströmMay 6, 2007
  5. David KågedalMay 13, 2007
  6. Karl HasselströmMay 13, 2007
  7. Karl HasselströmMay 5, 2007
  8. Chris ShoemakerMay 5, 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.