Git development
 help / color / mirror / Atom feed
From: "Julia Evans" <julia@jvns.ca>
To: "Junio C Hamano" <gitster@pobox.com>,
	"Julia Evans" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
Subject: Re: [PATCH v2] doc: checkout: rewrite detached HEAD state explanation
Date: Wed, 14 Oct 2026 17:10:40 -0400	[thread overview]
Message-ID: <18556e31-d85b-4b28-b01f-91ae99cbe9cc@app.fastmail.com> (raw)
In-Reply-To: <xmqqecdsru6l.fsf@gitster.g>

On Wed, Oct 14, 2026, at 2:52 PM, Junio C Hamano wrote:
> "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> Write a new explanation addressing these issues, and put it in a
>> standalone guide so that we can easily reference it from advice
>> ("see `git help detachedhead`").
>
> Isn't it 'git help detached-head' in this edition?

Will fix.

>> Co-authored-by: Marie Claire LeBlanc Flanagan <hello@marieflanagan.com>
>> Signed-off-by: Julia Evans <julia@jvns.ca>
>
> Can the other author also sign it off?

Will do.

>> +Git will eventually permanently delete those "garbage" commits during
>> +garbage collection. Those commits will be deleted after 90 days by
>> +default, see linkgit:git-gc[1] for more.
>
> Does this say 90 days because that is the gc.reflogExpire retention?

Yes, I wasn't sure how it works exactly.

> If you create a commit, change your mind, rewind the tip of the
> branch (e.g., with "git commit --amend"), and then keep working, the
> original commit before amending would be unreachable from the tip of
> that branch.  Its reflog entry would then expire after
> gc.reflogExpireUnreachable, which defaults to 30 days.  If your
> commit were created on a detached HEAD, I am not sure offhand how
> the thresholds for gc.reflogExpire and gc.reflogExpireUnreachable
> come into play for HEAD, as HEAD by default flips back and forth
> regularly across branch tips that are not reachable from each other.
> When "gc" kicks in, the commit HEAD currently points to is unlikely
> to reach the abandoned commit.
>
> It might be safer to either say "after 30 days by default" or
> generalize it to "after a few weeks by default" to avoid being
> overly prescriptive.

Will change to "30 days", I think "30 days" makes it a tiny bit easier
for someone to figure out where that number might come from.

>> diff --git a/advice.c b/advice.c
>> index 401d047391..43f86c2eaf 100644
>> --- a/advice.c
>> +++ b/advice.c
>> @@ -291,6 +291,7 @@ void detach_advice(const char *new_name)
>>  	"\n"
>>  	"  git switch -\n"
>>  	"\n"
>> +	"Run `git help detachedhead` to learn more.\n"
>
> "git help deatched-head" here, too.

Will do.

>>  	fprintf(stderr, fmt, new_name);
>> diff --git a/command-list.txt b/command-list.txt
>> index 63ae2a67c9..922a1dbd84 100644
>> --- a/command-list.txt
>> +++ b/command-list.txt
>> @@ -218,6 +218,7 @@ gitcore-tutorial                        guide
>>  gitcredentials                          guide
>>  gitcvs-migration                        guide
>>  gitdatamodel                            guide
>> +gitdetached-head                         guide
>>  gitdiffcore                             guide
>>  giteveryday                             guide
>>  gitfaq                                  guide
>
> This seems to be manually aligned with SP, so compensate the
> addition of "-" between detached and head by removing one SP before
> guide on the same line.

Will do.

      reply	other threads:[~2026-10-14 21:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 14:52 [PATCH] doc: checkout: rewrite detached HEAD state explanation Julia Evans via GitGitGadget
2026-10-07 16:43 ` Junio C Hamano
2026-10-13 12:54   ` Julia Evans
2026-10-07 19:02 ` Kristoffer Haugsbakk
2026-10-13 11:48   ` Julia Evans
2026-10-13 12:20     ` Kristoffer Haugsbakk
2026-10-13 12:27       ` Julia Evans
2026-10-13 12:42         ` Julia Evans
2026-10-13 13:01 ` [PATCH v2] " Julia Evans via GitGitGadget
2026-10-14 18:52   ` Junio C Hamano
2026-10-14 21:10     ` Julia Evans [this message]

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=18556e31-d85b-4b28-b01f-91ae99cbe9cc@app.fastmail.com \
    --to=julia@jvns.ca \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=kristofferhaugsbakk@fastmail.com \
    /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