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

Re: [RFC] Introduce .git/BRANCH to point to the current branch

From
Salikh Zakirov <salikh@gmail.com>
Date
Dec 4, 2007, 21:57 UTC
Message-ID
<4755CD32.7040204@gmail.com>
In-Reply-To
<m34peyur8r.fsf@roke.D-201>
Jakub Narebski wrote:
Show 6 quoted lines
>> Salikh Zakirov <salikh@gmail.com> writes:
>>> This combination leads to the confusing user experience
>>> if the branch changes independently of the working directory.
>>> This can happen in following cases:
> 
> All those cases are cases of not recommended workflows.

I guess those cases are not recommended exactly because there are prone to causing confusion with current git.

I use multiple workdirs quite often, and by now learned not to check out the same branch in different workdirs, but it would very convenient if it would not be necessary to remember it.

> Please search the archives for idea of BASE extension to index
> (instead of your separate file under .git/refs), and why it is
> not in current git.

I never realized this idea has been already tried. Thanks for the pointer! I would try to use BASE extension.

> BTW. how in your proposal would you detach HEAD?

Deleting .git/BRANCH should be enough. But I cannot see the workflow that would need it. If one checks out older state of the branch, there is no harm in maintaining the BRANCH pointer, as commits done in this state need to be manually merged in order to get into the branch, in the same way as detached head works currently.

Previous: Robin RosenbergNext: Junio C Hamano
Message 12 of 14 in “[RFC] Introduce .git/BRANCH to point to the current branch”
  1. Salikh ZakirovDec 4, 2007
  2. Matthieu MoyDec 4, 2007
  3. Jakub NarebskiDec 4, 2007
  4. Junio C HamanoDec 4, 2007
  5. Matthieu MoyDec 4, 2007
  6. Junio C HamanoDec 4, 2007
  7. git-checkout --push/--popNanako Shiraishi, Dec 4, 2007
  8. Junio C HamanoDec 5, 2007
  9. Matthieu MoyDec 5, 2007
  10. David KågedalDec 5, 2007
  11. Robin RosenbergDec 6, 2007
  12. Salikh ZakirovDec 4, 2007
  13. Junio C HamanoDec 4, 2007
  14. Jakub NarebskiDec 4, 2007

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.