git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khomoutov <flatworm@users.sourceforge.net>
To: tactical <a5158017@nepwk.com>
Cc: git@vger.kernel.org
Subject: Re: More Beginning Git Questions
Date: Mon, 26 Sep 2011 04:34:47 +0400	[thread overview]
Message-ID: <20110926003447.GG10955@localhost.localdomain> (raw)
In-Reply-To: <1ttmqsxtaj98i$.hv6s5shjeugr.dlg@40tude.net>

On Sun, Sep 25, 2011 at 10:07:24PM +0100, tactical wrote:

[...]
> > I think you can use detached HEAD for that, at least when working on
> > one issue at a time (you have to name branch when switching to some
> > other work).
> 
> But in Mercurial I can switch between anonymous branches as much as I like
> without anything ever being deleted.
> 
> >> From what I read, detached heads are subject to garbage collection.
> >  
> > No, HEAD is protected against garbage collecting.  To be sure you
> > should name a branch when switching branches, though reflog would
> > protect you for 30 days (by default) even if you don't do that.
> 
> So Git doesn't really support anonymous branching as part of a normal
> workflow.

I perceive a certain logical fallacy here: you cannot switch between
anything anonymous because to switch, you should somehow identify
something to switch to--a name in whatever sense we put into this word.
As I understand, by switching between branches in Mercurial you mean
switching between directories with clones; if so, you had had to name
those directories when they were created.

As to branches, they do have names in Git but they are very loosely
coupled with their names: tag a tip of some branch (to still have a
handle on that tip commit) then delete that branch--there will be no
traces of that branch's name left, the branch's name is not encoded in
its history in any way.  The branch names is just a way to not mess with
SHA-1 names of commits (and to have references to those commits to keep
them out of consideration for garbage collection).
Hence the idea to demand support for anonymous branches in Git's model
is just unfounded.

  reply	other threads:[~2011-09-26  0:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 14:41 More Beginning Git Questions Jon Forrest
2011-09-23 16:11 ` Matthieu Moy
2011-09-23 17:42 ` Jakub Narebski
2011-09-23 18:14   ` Jon Forrest
2011-09-23 18:44     ` Mihamina Rakotomandimby
2011-09-23 18:59     ` Jakub Narebski
2011-09-24 20:22     ` tactical
2011-09-24 20:53       ` Frans Klaver
2011-09-24 22:17         ` tactical
2011-09-24 22:59           ` Seth Robertson
2011-09-25  2:16             ` tactical
2011-09-25 13:22               ` Jakub Narebski
2011-09-25 20:23                 ` tactical
2011-09-25 20:58                   ` Jakub Narebski
2011-09-25 21:07                     ` tactical
2011-09-26  0:34                       ` Konstantin Khomoutov [this message]
2011-09-26  0:56                         ` tactical
2011-09-26  1:34                           ` Andrew Ardill
2011-09-26  1:42                             ` tactical
2011-09-26 18:03                           ` Jakub Narebski
2011-09-24 21:10       ` Jakub Narebski
2011-09-24 22:10         ` tactical
2011-09-25 13:24           ` Jakub Narebski
2011-09-23 18:47 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110926003447.GG10955@localhost.localdomain \
    --to=flatworm@users.sourceforge.net \
    --cc=a5158017@nepwk.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).