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

Re: [PATCH] rebase, cherry-pick, revert: only run from toplevel

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 31, 2021, 05:55 UTC
Message-ID
<38fef2e3-a78a-c83b-85f8-dae064931703@kdbg.org>
In-Reply-To
<pull.1083.git.git.1630379030665.gitgitgadget@gmail.com>
Am 31.08.21 um 05:03 schrieb Elijah Newren via GitGitGadget:
Show 12 quoted lines
> From: Elijah Newren <newren@gmail.com>
> 
> Allowing rebase, cherry-pick and revert to run from subdirectories
> inevitably leads to eventual user confusion.  For example, if they
> are within a directory that was created by one of the patches being
> rebased, then the rebase operation could hit a conflict before the
> directory is restored leading the user to be running from a directory
> that no longer exists.  Similarly with cherry-pick and revert, those
> operations could result in the directory being removed.
> 
> Similar to bisect, simply require that these commands be run from the
> toplevel to avoid such problems.

I am not a friend of this change. I understand the motivation behind it. But most of the time, rebase and cherry-pick are operated on own code, where directories do not disappear and appear at random, and this new enforced condition becomes awkward.

One of my use-cases is that I operate git-rebase from an untracked build directory inside the repository. Having to pass -C .. all the time strikes the wrong balance, IMO.

Things are slightly different for git-bisect (at least for me), because oftentimes it is operated on foreign code, where you may not know which directories come and go. But even that is a weak argument to force the command to the top-level of the repository.

Perhaps it is sufficient to force git-pull to the top-level (if it isn't already).

-- Hannes
Previous: Elijah NewrenNext: Jeff King
Message 3 of 12 in “rebase, cherry-pick, revert: only run from toplevel”
  1. rebase, cherry-pick, revert: only run from toplevelElijah Newren via GitGitGadget, Aug 31, 2021
  2. Elijah NewrenAug 31, 2021
  3. Johannes SixtAug 31, 2021
  4. Jeff KingAug 31, 2021
  5. Elijah NewrenAug 31, 2021
  6. Taylor BlauSep 1, 2021
  7. Elijah NewrenSep 1, 2021
  8. Taylor BlauSep 1, 2021
  9. Elijah NewrenSep 1, 2021
  10. Junio C HamanoSep 1, 2021
  11. Elijah NewrenSep 1, 2021
  12. Jeff KingSep 1, 2021

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.