From: Stefan Haller <lists@haller-berlin.de>
To: phillip.wood@dunelm.org.uk, git@vger.kernel.org
Cc: Derrick Stolee <derrickstolee@github.com>,
Elijah Newren <newren@gmail.com>,
Kristoffer Haugsbakk <code@khaugsbakk.name>
Subject: Re: Should --update-refs exclude refs pointing to the current HEAD?
Date: Thu, 20 Apr 2023 17:27:14 +0200 [thread overview]
Message-ID: <2db5c4a5-533a-f004-cf26-7ef938d1f94d@haller-berlin.de> (raw)
In-Reply-To: <98548a5b-7d30-543b-b943-fd48d8926a33@gmail.com>
On 17.04.23 14:14, Phillip Wood wrote:
> On 17/04/2023 09:21, Stefan Haller wrote:
>> Both of these cases could be fixed by --update-refs not touching any
>> refs that point to the current HEAD.
>
>> I'm having a hard time coming up
>> with cases where you would ever want those to be updated, in fact.
>
> If a user using stacked branches creates a new branch and then realizes
> they need to fix something on the parent before creating any commits on
> the new branch they would want both to be updated. e.g.
> $ git symbolic-ref HEAD
> refs/heads/topic
> $ git checkout -b another-topic
> # fix a bug in topic - want topic and another-topic to be
> # updated
> $ git rebase -i --update-refs HEAD~2
OK, this is indeed one situation where my proposed change would do the
wrong thing.
It is of course impossible for git to tell whether you were meaning to
create a stack of branches here, or whether this is one of the cases
where I'm creating a copy of a branch and want to "detach" it from its
source branch, as in the examples I posted earlier in this thread.
In my personal experience the latter is much more common than the
former, and it's also easier to correct the mistake manually in your
example by hard-resetting one branch to the other again, so I still
think it would be a useful change.
Any other opinions about this?
-Stefan
next prev parent reply other threads:[~2023-04-20 15:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 8:21 Should --update-refs exclude refs pointing to the current HEAD? Stefan Haller
2023-04-17 8:30 ` Stefan Haller
2023-04-17 8:34 ` Kristoffer Haugsbakk
2023-04-17 9:22 ` Stefan Haller
2023-04-18 2:00 ` Felipe Contreras
2023-04-17 12:14 ` Phillip Wood
2023-04-20 15:27 ` Stefan Haller [this message]
2024-03-05 7:40 ` Stefan Haller
2024-03-05 16:22 ` Junio C Hamano
2024-03-06 2:57 ` Elijah Newren
2024-03-06 21:00 ` Stefan Haller
2024-03-07 5:36 ` Elijah Newren
2024-03-07 20:16 ` Stefan Haller
2024-03-09 3:28 ` Elijah Newren
2024-03-12 9:28 ` Stefan Haller
2024-03-07 7:59 ` Kristoffer Haugsbakk
2024-03-07 8:22 ` Elijah Newren
2024-03-24 10:42 ` Stefan Haller
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=2db5c4a5-533a-f004-cf26-7ef938d1f94d@haller-berlin.de \
--to=lists@haller-berlin.de \
--cc=code@khaugsbakk.name \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).