git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Lost association between TAGS and COMMITs when rebased a git(1) repository

From
knittl <knittl89@googlemail.com>
Date
Sep 4, 2011, 14:30 UTC
Message-ID
<CACx-yZ3tav1sJnLtJOn_YugQOsM9ERi7Cc7SowunyobxxX5YdA@mail.gmail.com>
In-Reply-To
<FF0364F3D5244CA4987EDDCFE7244BF3@urbanjsPC>
On Sun, Sep 4, 2011 at 3:32 AM, 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.

Use git notes[1] to attach additional info to existing commits. Git notes will by default be copied when using git rebase or git commit --amend (cf. notes.rewrite.<command> config)

Show 6 quoted lines
> 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"?

"Rebase" takes commits and creates new commits from those. The new commits are not the same as the old, although they might have associated the same tree or changeset.

Show 5 quoted lines
> 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?

Tags can point to any git object (commits, trees, blobs, notes, even to other annotated tags). There's nothing wrong with that.

[1]: http://www.kernel.org/pub/software/scm/git/docs/git-notes.html

-- typed with http://neo-layout.org myFtPhp -- visit http://myftphp.sf.net -- v. 0.4.7 released!

Previous: knittlNext: Michael Witten
Message 7 of 20 in “Lost association between TAGS and COMMITs when rebased a git(1) repository”
  1. John S. UrbanSep 4, 2011
  2. PJ WeisbergSep 4, 2011
  3. Michael WittenSep 4, 2011
  4. Michael WittenSep 4, 2011
  5. Philip OakleySep 4, 2011
  6. knittlSep 4, 2011
  7. knittlSep 4, 2011
  8. Michael WittenSep 4, 2011
  9. Jakub NarebskiSep 4, 2011
  10. Tor ArntsenSep 4, 2011
  11. Thomas RastSep 4, 2011
  12. Tor ArntsenSep 4, 2011
  13. John S. UrbanSep 4, 2011
  14. Documentation: "on for all" configuration of notes.rewriteRefThomas Rast, Sep 4, 2011
  15. Tor ArntsenSep 4, 2011
  16. Jeff KingSep 7, 2011
  17. Thomas RastSep 7, 2011
  18. Jeff KingSep 7, 2011
  19. Michael WittenSep 4, 2011
  20. John S. UrbanSep 4, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.