git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Should --update-refs exclude refs pointing to the current HEAD?
@ 2023-04-17  8:21 Stefan Haller
  2023-04-17  8:30 ` Stefan Haller
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Stefan Haller @ 2023-04-17  8:21 UTC (permalink / raw)
  To: git; +Cc: Derrick Stolee, , Elijah Newren, , Phillip Wood

The --update-refs option of git rebase is so useful that I have it on by
default in my config. For stacked branches I find it hard to think of
scenarios where I wouldn't want it.

However, there are cases for non-stacked branches (i.e. other branches
pointing at the current HEAD) where updating them is undesirable. In
fact, pretty much always, for me. Two examples, both very similar:

1. I have a topic branch which is based off of master; I want to make a
copy of that branch and rebase it onto devel, just to try if that would
work. I don't want the original branch to be moved along in this case.

2. I have a topic branch, and I want to make a copy of it to make some
heavy history rewriting experiments. Again, my interactive rebases would
always rebase both branches in the same way, not what I want. In this
case I could work around it by doing the experiments on the original
branch, creating a tag beforehand that I could reset back to if the
experiments fail. But maybe I do want to keep both branches around for a
while for some reason.

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.

Any opinions?

-Stefan


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-03-24 10:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).