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

Re: [RFC/PATCH] rebase -i: add run command to launch a shell command

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 2, 2010, 21:15 UTC
Message-ID
<7vwrs8k978.fsf@alter.siamese.dyndns.org>
In-Reply-To
<vpqwrs9nxi5.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 16 quoted lines
> That's a good question. My original patch was running the command from
> the toplevel, which is the natural way to implement it. I've changed
> my mind to execute the command from the place where "git rebase -i"
> was started (which means this has to be memorized in a temporary file
> to be persistant accross "git rebase --continue"). I think this makes
> more sense for the user, and I've actually already been biten by the
> old behavior, running "rebase -i" from a doc/ subdirectory, and
> wondering why my "exec make" was rebuilding the code itself.
>
> This comes with at least one drawback: if directory from which the
> rebase was started didn't exist in the past, then we can't do a simple
> "cd" to it. My implementation re-creates the directory temporarily, so
> that the command can run, and cleans it up afterwards. The only really
> problematic case is when the directory can not be created (like
> directory/file conflict). It this case, the command is not ran, and
> the script exits.

Sorry to join the discussion after you have already coded it, but I don't think running the external command at a random subdirectory that the operation happened to have started makes much sense, as rebase is a tree-wide operation. The user if s/he so chooses can chdir down (if the directory still exists in the revision in question) in the script, but I think the built-in behaviour should be to just run it from the toplevel.

Previous: Paolo BonziniNext: Matthieu Moy
Message 20 of 27 in “rebase -i: add run command to launch a shell command”
  1. rebase -i: add run command to launch a shell commandMatthieu Moy, Jul 28, 2010
  2. Santi BéjarJul 28, 2010
  3. Matthieu MoyJul 28, 2010
  4. Matthieu MoyJul 30, 2010
  5. Marc BranchaudJul 30, 2010
  6. Matthieu MoyJul 30, 2010
  7. Neal KreitzingerJul 30, 2010
  8. Matthieu MoyJul 31, 2010
  9. Ævar Arnfjörð BjarmasonJul 31, 2010
  10. Miles BaderJul 31, 2010
  11. Matthieu MoyAug 2, 2010
  12. rebase -i: add exec command to launch a shell commandMatthieu Moy, Aug 2, 2010
  13. Jared HanceAug 2, 2010
  14. Ævar Arnfjörð BjarmasonAug 2, 2010
  15. Johannes SixtAug 6, 2010
  16. Matthieu MoyAug 7, 2010
  17. 1/2 rebase -i: add exec command to launch a shell commandMatthieu Moy, Aug 7, 2010
  18. 2/2 test-lib: user-friendly alternatives to test [!] [-d|-f]Matthieu Moy, Aug 7, 2010
  19. Paolo BonziniAug 2, 2010
  20. Junio C HamanoAug 2, 2010
  21. Matthieu MoyAug 3, 2010
  22. Kris ShannonAug 3, 2010
  23. Matthieu MoyAug 3, 2010
  24. Paolo BonziniJul 31, 2010
  25. Ævar Arnfjörð BjarmasonJul 31, 2010
  26. Jared HanceJul 31, 2010
  27. Jared HanceJul 31, 2010

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.