From: Sergey Organov <sorganov@gmail.com> To: Philip Oakley <philipoakley@iee.email> Cc: Junio C Hamano <gitster@pobox.com>, "Eric W. Biederman" <ebiederm@xmission.com>, Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>, git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de> Subject: Re: [PATCH 00/28] Use main as default branch name Date: Sun, 22 Nov 2020 16:23:30 +0300 Message-ID: <87zh397cfh.fsf@osv.gnss.ru> (raw) In-Reply-To: <9be54e8e-a702-0eb9-97c9-7a1fac82ed5d@iee.email> (Philip Oakley's message of "Sun, 22 Nov 2020 11:20:26 +0000") Philip Oakley <philipoakley@iee.email> writes: > On 22/11/2020 10:21, Sergey Organov wrote: >> Junio C Hamano <gitster@pobox.com> writes: >> >>> Sergey Organov <sorganov@gmail.com> writes: >>> >>>> To me "not on a branch [tip]" is also confusing, as in fact you are, as >>>> is easily seen after you perform a few commits, and now HEAD points >>>> directly to the tip of the branch (that has no other references). >>> Aren't you confused about what "on a branch" means? >> I believe I'm not. > > Isn't this one of those "implementation detail" viewpoint arguments, > combined with some incompleteness in various places. > > From a naive english user perspective , 'on' a branch can also mean > anywhere along a branch and not just at the tip. Being at a commit along > a branch can be tricky to appreciate (that on/at distinction isn't > immediately obvious..) >> >>> After either of these two operations, your HEAD may point at the >>> same commit, but the former is on a branch (the master branch), and >>> the latter is not. >>> >>> git checkout master >>> git checkout master^0 >>> >>> The difference between these two states does *NOT* come from which >>> commit HEAD points at. >> Sure. > From an implementation perspective one can go two ways, and we tell the > user which way we went, even though, ultimately, we look at the same > commit. AFAIU, the only difference is that HEAD points to the commit directly in the case of "detached HEAD", while it points to the commit indirectly through the branch reference in the usual case. > > Though, for an unborn branch we don't have a null commit value (c.f. > empty tree) to help in being 'detached at nowhere'. We can pretend we have a null commit for the sake of regularity, even though Git implementation has none. Actually, it looks like a few things would be easier if Git got the "Adam" commit that is the ultimate final parent of everything in the first place, but it didn't. >> >>> The difference comes from what happens when you make a new commit >>> starting from that state. The former (i.e. you are on a branch) >>> grows the branch. >> Sure. >> >>> The latter (i.e. you are not on a branch) does not grow any branch. >> That's one way of looking at it, resulting in this "detached HEAD" >> thingy that is too technical for the git user proper, I think. Moreover, >> it immediately raises the question: if it doesn't grow any branch, /what/ >> does it grow? >> >> Another way of describing it, that I prefer, is that you /are/ on an >> /unnamed/ branch and new commits grow this particular /unnamed/ branch. >> No need not only for "detached", but even for "HEAD" to be known to the >> user to get the idea, I think. > I don't think we can start like this and continue with a commit on top > of the orphaned 'unnamed' branch. (Not tried it though..) I rather believe we can, no problems, and that's why "detached HEAD" behaves exactly as unnamed branch would. To make it obvious "detached HEAD" is in fact a subset of the usual case, imagine that "detached HEAD" is rather first implemented by pointing to a branch reference with a hidden name that in turn points to the commit, and then this "incognito branch reference" is optimized-out as being invisible anyway, so HEAD now points to the commit itself. -- Sergey Organov
next prev parent reply other threads:[~2020-11-22 13:25 UTC|newest] Thread overview: 163+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-12 22:43 Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 01/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 02/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 03/28] t2*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 04/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 05/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 06/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 07/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 08/28] t4*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 09/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 10/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 11/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 12/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 13/28] t551*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 14/28] t55[23]*: " Johannes Schindelin via GitGitGadget 2020-11-13 10:02 ` Ævar Arnfjörð Bjarmason 2020-11-13 14:18 ` Johannes Schindelin 2020-11-16 20:07 ` Junio C Hamano 2020-11-12 22:43 ` [PATCH 15/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 16/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 17/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 18/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 19/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 20/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 21/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 22/28] t8*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 23/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 24/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 25/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 26/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 27/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget 2020-11-12 22:43 ` [PATCH 28/28] Change the default branch name to `main` Don Goodman-Wilson via GitGitGadget 2020-11-13 9:57 ` Ævar Arnfjörð Bjarmason 2020-11-13 14:09 ` Johannes Schindelin 2020-11-16 20:04 ` Junio C Hamano 2020-11-13 0:11 ` [PATCH 00/28] Use main as default branch name Felipe Contreras 2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason 2020-11-13 14:22 ` Johannes Schindelin 2020-11-13 16:13 ` [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of) Ævar Arnfjörð Bjarmason 2020-11-13 19:14 ` Jeff King 2020-11-13 22:00 ` Johannes Schindelin 2020-11-13 22:39 ` Johannes Schindelin 2020-11-13 23:49 ` Ævar Arnfjörð Bjarmason [not found] ` <nycvar.QRO.7.76.6.2011162118060.18437@tvgsbejvaqbjf.bet> 2020-11-18 13:32 ` Ævar Arnfjörð Bjarmason 2020-11-18 14:16 ` Felipe Contreras 2020-11-20 11:36 ` Ævar Arnfjörð Bjarmason 2020-11-20 16:00 ` Felipe Contreras 2020-11-18 15:56 ` Junio C Hamano 2020-11-19 9:32 ` Johannes Schindelin 2020-11-19 19:35 ` Junio C Hamano 2020-11-22 19:07 ` Johannes Schindelin 2020-11-19 10:46 ` Johannes Schindelin 2020-11-14 0:25 ` Felipe Contreras 2020-11-13 17:42 ` [PATCH 00/28] Use main as default branch name Felipe Contreras 2020-11-14 6:13 ` Junio C Hamano 2020-11-16 19:52 ` Junio C Hamano 2020-11-17 16:10 ` Johannes Schindelin 2020-11-17 19:09 ` Junio C Hamano 2020-11-18 20:58 ` Johannes Schindelin 2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 01/27] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 02/27] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 03/27] t2*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 04/27] t3[0-3]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 05/27] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 06/27] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 07/27] t3[5-9]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 08/27] t4*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 09/27] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 10/27] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 11/27] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 12/27] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 13/27] t551*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 14/27] t55[23]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 15/27] t55[4-9]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 16/27] t5[6-9]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 17/27] t6[0-3]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 18/27] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 19/27] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 20/27] t7[0-4]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 21/27] t7[5-9]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 22/27] t8*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 23/27] t9[0-4]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 24/27] t9[5-7]*: " Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 25/27] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 26/27] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-17 16:12 ` [PATCH v2 27/27] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget 2020-11-18 11:48 ` [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH Ævar Arnfjörð Bjarmason 2020-11-18 23:56 ` Johannes Schindelin 2020-11-19 19:30 ` Junio C Hamano 2020-11-20 13:09 ` Johannes Schindelin 2020-11-20 18:08 ` Junio C Hamano 2020-11-18 23:44 ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 01/28] tests: mark tests relying on the current default for `init.defaultBranch` Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 02/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 03/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 04/28] t2*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 05/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 06/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 07/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 08/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 09/28] t4*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 10/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 11/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 12/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 13/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 14/28] t551*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 15/28] t55[23]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 16/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 17/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 18/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 19/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 20/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 21/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 22/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 23/28] t8*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 24/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 25/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 26/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 27/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget 2020-11-18 23:44 ` [PATCH v3 28/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget 2020-11-19 23:35 ` [PATCH v3 00/28] tests: use main as default branch name Junio C Hamano 2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman 2020-11-17 22:47 ` Felipe Contreras 2020-11-17 23:33 ` Jeff King 2020-11-18 0:07 ` Junio C Hamano 2020-11-18 1:25 ` Jeff King 2020-11-18 2:40 ` Jonathan Nieder 2020-11-18 5:43 ` Junio C Hamano 2020-11-18 11:32 ` Johannes Schindelin 2020-11-18 15:43 ` Junio C Hamano 2020-11-19 9:22 ` Johannes Schindelin 2020-11-18 0:18 ` Felipe Contreras 2020-11-18 1:22 ` Jeff King 2020-11-18 1:45 ` Felipe Contreras 2020-11-18 2:06 ` Jeff King 2020-11-18 2:39 ` Jonathan Nieder 2020-11-18 10:12 ` Felipe Contreras 2020-11-18 9:04 ` Felipe Contreras 2020-11-17 22:55 ` Junio C Hamano 2020-11-17 23:16 ` Felipe Contreras 2020-11-18 0:10 ` Junio C Hamano 2020-11-18 0:51 ` Felipe Contreras 2020-11-18 23:45 ` Philip Oakley 2020-11-19 0:00 ` Johannes Schindelin 2020-11-19 0:30 ` Philip Oakley 2020-11-19 0:30 ` Peter Hadlaw 2020-11-19 0:44 ` Philip Oakley 2020-11-19 0:55 ` Peter Hadlaw 2020-11-19 1:51 ` Junio C Hamano 2020-11-19 10:35 ` Philip Oakley 2020-11-19 11:10 ` Sergey Organov 2020-11-19 11:50 ` Philip Oakley 2020-11-19 12:33 ` Sergey Organov 2020-11-21 23:01 ` Junio C Hamano 2020-11-22 10:21 ` Sergey Organov 2020-11-22 11:20 ` Philip Oakley 2020-11-22 13:23 ` Sergey Organov [this message] 2020-11-22 20:18 ` Philip Oakley 2020-11-22 21:56 ` Felipe Contreras 2020-11-22 23:54 ` Junio C Hamano 2020-11-18 2:56 ` Jonathan Nieder 2020-11-18 5:57 ` 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 List information: http://vger.kernel.org/majordomo-info.html * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=87zh397cfh.fsf@osv.gnss.ru \ --to=sorganov@gmail.com \ --cc=ebiederm@xmission.com \ --cc=git@vger.kernel.org \ --cc=gitgitgadget@gmail.com \ --cc=gitster@pobox.com \ --cc=johannes.schindelin@gmx.de \ --cc=philipoakley@iee.email \ /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
git@vger.kernel.org list mirror (unofficial, one of many) This inbox may be cloned and mirrored by anyone: git clone --mirror https://public-inbox.org/git git clone --mirror http://ou63pmih66umazou.onion/git git clone --mirror http://czquwvybam4bgbro.onion/git git clone --mirror http://hjrcffqmbrq6wope.onion/git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V1 git git/ https://public-inbox.org/git \ git@vger.kernel.org public-inbox-index git Example config snippet for mirrors. Newsgroups are available over NNTP: nntp://news.public-inbox.org/inbox.comp.version-control.git nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git nntp://news.gmane.io/gmane.comp.version-control.git note: .onion URLs require Tor: https://www.torproject.org/ code repositories for the project(s) associated with this inbox: https://80x24.org/mirrors/git.git AGPL code for this site: git clone https://public-inbox.org/public-inbox.git