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

Re: A few "linked checkout" niggles

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 16, 2015, 05:40 UTC
Message-ID
<CAPig+cQ9V0rmZZrhB=dCu01kiCGpyNVmx7PeXQqBQ=zvk_DF3g@mail.gmail.com>
In-Reply-To
<CACsJy8CLYz7HqScS5Bxo47kTbrNj=qsaZnkKQ9ob4UVbjGG62Q@mail.gmail.com>
On Thu, Jul 16, 2015 at 1:24 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 16 quoted lines
> On Thu, Jul 16, 2015 at 6:13 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> I've tried to set up a non-bare clone of git.git at ~/w/src and
>> attached one of its branches to a separate work tree at ~/w/rerere
>>
>>  ~/w/src$ git worktree add ../rerere jc/rerere
>>
>> Then I tried the "multiple checkout not allowed".
>>
>>  ~/w/src$ git checkout jc/rerere
>>  fatal: 'jc/rerere' is already checked out at '/home/gitster/w/rerere/.git'
>>
>> You see the first "niggle" above.  Do we need "/.git" at the end?
>> That is hopefully merely cosmetic and I am guessing that we can
>> unconditionally drop "/.git" from the end, but maybe there are
>> subtle reasons why it may not be a good idea (e.g. introduces some
>> ambiguities?)

I can't think of any ambiguities which might arise from stripping the .git suffix. Even when playing with GIT_COMMON_DIR and GIT_WORK_TREE, I don't notice any ambiguities.

Since I'm already touching this code and am wrapping up v2 of [1], I can easily plop in a fix for this cosmetic issue.

Show 14 quoted lines
>> There is another, a more serious one.
>>
>>  ~/w/src$ git fetch ../git.git jc/rerere:jc/rerere
>>
>> This succeeds, without checking if there is a work tree that has it
>> checked out.  I think the safety in "git fetch" that can be disabled
>> by "--update-head-ok" option should be updated to reuse the same
>> protection used by the updated "git checkout".
>>
>> Something to work on for 2.5.x maintenance track, aiming for 2.5.1.
>
> To keep things clear, Eric if you want these they are yours :-) I'll
> focus on the submodule support after i'm done with all my bug fix
> patches.

I want to focus on getting v2 of [1] out and finalized. After that, I might be able to take a look at the git-fetch issue (but I won't complain if you get to it first).

[1]: http://thread.gmane.org/gmane.comp.version-control.git/273856
Previous: Duy NguyenNext: Junio C Hamano
Message 3 of 11 in “A few "linked checkout" niggles”
  1. Junio C HamanoJul 15, 2015
  2. Duy NguyenJul 16, 2015
  3. Eric SunshineJul 16, 2015
  4. Junio C HamanoJul 16, 2015
  5. Duy NguyenJul 16, 2015
  6. Eric SunshineJul 17, 2015
  7. Michael J GruberJul 17, 2015
  8. Duy NguyenJul 17, 2015
  9. Junio C HamanoJul 17, 2015
  10. Eric SunshineJul 17, 2015
  11. Eric SunshineJul 17, 2015

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.