From: PJ Weisberg <pj@irregularexpressions.net>
To: "John S. Urban" <urbanjost@comcast.net>
Cc: git@vger.kernel.org
Subject: Re: Lost association between TAGS and COMMITs when rebased a git(1) repository
Date: Sun, 4 Sep 2011 03:02:27 -0700 [thread overview]
Message-ID: <CAJsNXTmJo6UXYS4AXygSLq2+T8MV0Sp0KhUt_mvgMqxC_k27ig@mail.gmail.com> (raw)
In-Reply-To: <FF0364F3D5244CA4987EDDCFE7244BF3@urbanjsPC>
On Sat, Sep 3, 2011 at 6:32 PM, John S. Urban <urbanjost@comcast.net> wrote:
> With my first use of git(1) I created a small project with about 200
> "commits". When this was complete, I needed to label each commit with
> information pointing it to a section of a document. I used tags for this. So
> far, everything was fine. I was then asked to merge two commits
> into one. I then did a "rebase" (for the first time). I then appear to have
> lost all association between the tags and the effected commits; as all
> commits after
> the ones I modified no longer see "their" tags. Was there a way to have kept
> the tags associated with the original commits as they were "rebased"?
When Old Biff Tannen traveled back to the year 1955 and gave his
younger self a copy of Grays Sports Almanac, which listed the outcomes
of every major sporting event from the years 1950-2000, the timeline
skewed, creating an alternate reality in which he had won enough money
through gambling to take over the town of Hill Valley. If Marty McFly
had kept a reflog, like Git does, he could have backtracked in his
personal history and just not left the almanac and the time machine
where Biff could find them. Instead, he had to go back to 1955 and
steal the almanac from young Biff after old Biff had given it to him.
But this metaphor is getting silly, and alienating anyone who wasn't
watching American movies in the late 1980s.
My point is that the tags are still there, and they still point to the
same commits they always pointed to. It's just that those commits are
part of the original history, not the alternate history created by the
rebase. People say that Git can "rewrite" history, but really it
creates a new history for the branch. The old history is still around
as long as there are references to it, until the garbage collector
picks it up.
Once a tag points to a commit, it isn't meant to be easy to make it
point to a different commit. For the same reason that you wouldn't
release version 1.8.3 of some software, and then later make a new
release also called 1.8.3.
> Also, I have some commits with multiple tags pointing to them. It has come
> to my attention that might not be an intentional feature. I could find
> nothing in the documentation explicitly stating multiple tags were allowed
> to point to a commit; but the tags seem to be unique "objects" so I
> see no reason this should not be an expected feature?
There's no reason you can't have multiple tags pointing to the same commit.
> Thanks for any insights. Other than loosing association between the tags and
> the commits with rebase (which I was hesitant to use; and am now
> doubly so) I found git(1) to be the first version control system better than
> "be careful and make tar-balls of major releases"; although I am just
> starting to get an idea of how the pieces work.
It's generally accepted that rebasing commits that other people have
had access to is a bad idea. :-)
-PJ
next prev parent reply other threads:[~2011-09-04 10:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-04 1:32 Lost association between TAGS and COMMITs when rebased a git(1) repository John S. Urban
2011-09-04 10:02 ` PJ Weisberg [this message]
2011-09-04 13:40 ` Michael Witten
2011-09-04 14:03 ` Michael Witten
[not found] ` <CA+sFfMcMgPDyCi6SCS=Sc4XFrug_Ee7vbmBBkmkwfwwpXg8yCg@mail.gmail.com>
2011-09-04 14:38 ` Michael Witten
2011-09-04 17:20 ` Philip Oakley
2011-09-04 18:15 ` knittl
2011-09-04 14:30 ` knittl
2011-09-04 14:43 ` Michael Witten
2011-09-04 15:39 ` Jakub Narebski
2011-09-04 18:16 ` Tor Arntsen
2011-09-04 18:43 ` Thomas Rast
2011-09-04 19:11 ` Tor Arntsen
2011-09-04 20:18 ` John S. Urban
2011-09-04 20:28 ` [PATCH] Documentation: "on for all" configuration of notes.rewriteRef Thomas Rast
2011-09-04 20:43 ` Tor Arntsen
2011-09-07 21:23 ` Jeff King
2011-09-07 21:29 ` Thomas Rast
2011-09-07 21:35 ` Jeff King
[not found] ` <CACx-yZ1Ce3x=ZSdm5iY3JqYjVGVs5uPnb12-tMJP7zWsGuMK_Q@mail.gmail.com>
2011-09-04 16:40 ` Lost association between TAGS and COMMITs when rebased a git(1) repository John S. Urban
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=CAJsNXTmJo6UXYS4AXygSLq2+T8MV0Sp0KhUt_mvgMqxC_k27ig@mail.gmail.com \
--to=pj@irregularexpressions.net \
--cc=git@vger.kernel.org \
--cc=urbanjost@comcast.net \
/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).