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

Re: [PATCH] rebase: learn --discard subcommand

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
May 29, 2011, 13:14 UTC
Message-ID
<alpine.DEB.2.00.1105290850340.28815@debian>
In-Reply-To
<7vpqn2psjv.fsf@alter.siamese.dyndns.org>
On Sat, 28 May 2011, Junio C Hamano wrote:
Show 20 quoted lines
> Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
> 
> > ... I think Junio then
> > hinted that he sometimes wished that he could abort rebase without
> > moving to anywhere else at all, which is what this patch implements.
> 
> I am not opposed to this particular patch, but thinking about a bigger
> picture, I am not sure if we want to solve it this way.
> 
> We have multiple "sequence" operations that want to do things in multiple
> steps, each of which can stop and give control back to the user, while
> leaving some information in the .git directory for it to know where it was
> when resuming. I think "am" knows about what "rebase" does (and
> vice-versa) so it can detect an attempt to run it while "rebase" is in
> still progress and refuse to continue to limit the damage, but if we have
> N such "sequence" commands that want to refrain from interfering with each
> other, and want to offer an advice to abort the in-progress operation
> initiated by other commands, that would mean we would need N * N pieces of
> logic to detect other's in-limbo state and offer advices, which would not
> scale.

Makes sense. I think someone once suggested to have a .git/inprogress directory that would contain some basic information that could be used to diagnose in a generic way what operation might be in progress.

Show 9 quoted lines
> A user who is given back the control from a "sequence" operation may be
> confused either (1) immediately after such an event (often some sort of
> merge conflict) or (2) much later after first abandoning the working tree
> altogether and taking a walk and then coming back to continue working
> while forgetting what he was doing. Such a user may want to say "I know I
> am in a strange state, give me a state that I can work from, at this point
> I do not care about continuing what I was originally doing". The user may
> probably not know if "git rebase" was in progress or "git cherry-pick"
> was.

Maybe the recent patch [1] about adding information to git status about any ongoing operation would help. I'm not sure, but I think I would personally be a bit hesitant to cancel the current sequence operation without first checking what it was. OTOH, if I don't even remember starting a rebase operation, maybe knowing whether it was a rebase or an am operation might not help much. But if the message from git status would actually say something like "rebase in progress: [2/3] War on nbsp: a bit of retreat", then that might help more in making a decision to cancel or not.

 [1] http://thread.gmane.org/gmane.comp.version-control.git/172919
Previous: Jonathan NiederNext: Jakub Narebski
Message 7 of 17 in “rebase: learn --discard subcommand”
  1. rebase: learn --discard subcommandMartin von Zweigbergk, May 28, 2011
  2. Ramkumar RamachandraMay 28, 2011
  3. Martin von ZweigbergkMay 29, 2011
  4. Junio C HamanoMay 28, 2011
  5. Tim MazidMay 28, 2011
  6. Jonathan NiederMay 28, 2011
  7. Martin von ZweigbergkMay 29, 2011
  8. Jakub NarebskiMay 29, 2011
  9. Michael HaggertyMay 30, 2011
  10. Jonathan NiederMay 28, 2011
  11. Tim MazidMay 29, 2011
  12. Martin von ZweigbergkMay 29, 2011
  13. Jonathan NiederMay 29, 2011
  14. Michael HaggertyMay 30, 2011
  15. Tim MazidMay 30, 2011
  16. Michael HaggertyMay 30, 2011
  17. Miles BaderMay 30, 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.