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

Re: [PATCH 0/1] Introduce a way to create a branch and worktree at the same time

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Mar 11, 2016, 02:57 UTC
Message-ID
<CAHYJk3Sij4tH0i29Asahjj8KBdQj59jFRTCoYzO_XE_kt3SnDw@mail.gmail.com>
In-Reply-To
<alpine.DEB.2.20.1603101417590.4690@virtualbox>

On Thu, Mar 10, 2016 at 2:21 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 29 quoted lines
> Hi Duy,
>
> On Thu, 10 Mar 2016, Duy Nguyen wrote:
>
>> On Thu, Mar 10, 2016 at 6:34 PM, Johannes Schindelin
>> <johannes.schindelin@gmx.de> wrote:
>> > One possible improvement would be to add "/xyz/" to the parent
>> > repository's .git/info/exclude, but this developer hesitates to
>> > introduce that feature without the "delete" counterpart: those exclude
>> > entries would likely go stale very quickly. Besides, there might be a
>> > plan in the working to exclude worktrees automagically?
>>
>> That's needed because you add a worktree inside another worktree? I
>> know that feeling, but I've changed my layout from ~/w/git as main
>> worktree (and ~/w/git/.git as repo) to ~/w/git as a non-worktree dir
>> that contains all worktrees, e.g. ~/w/git/reinclude-dir,
>> ~/w/git/worktree-config, ~/w/git/lmdb... My typical worktree add
>> command is "git worktree add ../<some-name>" then move there and do
>> stuff. No nested worktrees, no need to update exclude file (and no
>> messing up emacs' rgrep command, which does not understand .gitignore
>> anyway)
>
> This feels to me like it is working around the problem rather than solving
> it. My worktrees are inside the corresponding top-level project for a
> reason: I work with multiple projects, and having all of their worktrees
> in a single $HOME/w/ directory would be rather confusing to me.
>
> I really want to keep my Git worktrees inside /usr/src/git/ (in Git for
> Windows' SDK).

You can have /usr/src/git/master, /usr/src/git/some-work-tree, etc, and /usr/src/git itself is not a git repository at all. That way /usr/src only has one git-related directory and no worktrees are nested. The only downside is if you work in master most of the time, you have to type "/master" more. I think this is what Duy suggested too, but you interpreted it as having /usr/src/git-master, /usr/src/git-some-work-tree etc?

-- 
Mikael Magnusson
Previous: Duy NguyenNext: Johannes Schindelin
Message 13 of 16 in “Introduce a way to create a branch and worktree at the same time”
  1. 0/1 Introduce a way to create a branch and worktree at the same timeJohannes Schindelin, Mar 10, 2016
  2. 1/1 branch: allow conveniently adding new worktrees for new branchesJohannes Schindelin, Mar 10, 2016
  3. Duy NguyenMar 10, 2016
  4. Duy NguyenMar 10, 2016
  5. Johannes SchindelinMar 10, 2016
  6. Johannes SchindelinMar 10, 2016
  7. Duy NguyenMar 11, 2016
  8. Junio C HamanoMar 11, 2016
  9. Johannes SchindelinMar 15, 2016
  10. Duy NguyenMar 15, 2016
  11. Johannes SchindelinMar 15, 2016
  12. Duy NguyenMar 15, 2016
  13. Mikael MagnussonMar 11, 2016
  14. Johannes SchindelinMar 14, 2016
  15. Johannes SixtMar 15, 2016
  16. Eric SunshineMar 10, 2016

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.