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
Junio C Hamano <gitster@pobox.com>
Date
Dec 4, 2007, 21:48 UTC
Message-ID
<7veje23zcy.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<vpq4peyjgd7.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 13 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Having said that, I am not sympathetic to "I have to remember".
>
> That's definitely not an important point, but I find it conveinient,
> for example in hg, to be able to just "hg update" to get to the tip of
> a branch.
>
> A use-case (which joins the one of Salikh actually) is to publish both
> a repository and a working tree (I do that for my collegues which may
> or (usually) may not use git). Making a hook to update the working
> tree after a push is a terrible hack in git, and just "hg update" in
> Mercurial.

That's a different issue. The reason push-into-a-live-tree works that way in Hg is because they have this implicit notion of unmerged heads that is merged with the next "hg update". We don't.

Instead, we are more explicit. If you want to emulate that workflow in git, you would prepare a reception branch, and have people push into it (see gitfaq and look for "sync out of a firewalled host". In the FAQ entry, pretend as if machineA is such a live work tree you are working in, and allow people to push into --- that B/master is the reception branch, although the FAQ entry is about your private use and written as if only you from a satellite machine can push into it, it can easily be a shared branch).

Instead of saying "hg update", you (the person working in such a live work tree that allows others to push into) merge that reception branch.

Previous: Matthieu MoyNext: Nanako Shiraishi
Message 6 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.