1
0
mirror of https://github.com/git/git synced 2024-07-05 00:58:49 +00:00
Commit Graph

6 Commits

Author SHA1 Message Date
Junio C Hamano
fa82cf43b1 Meta/post-applypatch: don't contaminate amlog with useless "reverse mapping"
The notes/amlog database is used to annotate individual commits that
result from "git am" application.  A note is attached to the commit
object and record s the Message-ID of the incoming e-mailed patch
that resulted in the commit, so "git show --notes=amlog" would
easily show where the commit came from.  The rewrite-hook mechanism
can be used to maintain the notes across rebasing and amending (but
cherry-pick does not preserve the note by design---the maintainer
has to be careful to avoid using cherry-pick).  One message can and
does result in multiple commits, and the mapping worked naturally in
this direction.

Originally it felt like a good idea to create a blob object that has
a Message-ID in it, and annotate the blob object with a note message
that has the name of the commit object that results by running "git
am" on the message, and mix such records in the notes database.
When you have a message, from the Message-ID, you can manufacture a
blob that has the Message-ID in it and ask the notes database about
the note attached to it, effectively giving you a reverse mapping.

This was ugly, unnecessary and unworkable at the same time.

 - These blobs with message-ID in them are not anchored by any ref;
   the reverse mapping entries in the notes tree were subject to be
   gc'ed any time.

 - "git grep -e '<message-id>' notes/amlog" essentially gives a
   mechanism that is quick enough to find what commits resulted from
   a message.

 - There is no machinery that helps these reverse mapping notes to
   be maintained across rebases and amends.  Because a single "git
   am" session is often far from enough for an e-mailed patch, these
   "reverse" entries that were created upon the first application
   quickly became stale pointing at commits that have been amended
   away.  There often are more than one commit that result from the
   same message on topic branches while the right base is being
   selected, so "the last one wins" rule, if it were even possible
   to implement, wouldn't have been sufficient.

Since grepping for the Message-ID in the notes database, i.e.  using
the forward mapping, gives an access to the necessary piece of
information reliably and quicly enough, let's retire the failed
attempt to throw reverse mapping entries in to the "amlog" notes.
2020-12-21 15:58:44 -08:00
Junio C Hamano
0c49ca3332 Meta/post-applypatch: use bidirectional notes mapping in amlog 2012-09-27 18:22:55 -07:00
Junio C Hamano
24a23ec19f post-applypatch: a bit more commenting
... with no functionality change.
2011-05-31 12:57:36 -07:00
Junio C Hamano
ea4a8a7a00 post-applypatch: 'git notes edit -m' is deprecated 2010-02-23 17:23:15 -08:00
Junio C Hamano
76adaf5aec post-applypatch: allow folded Message-ID line 2010-02-07 18:13:32 -08:00
Junio C Hamano
0197e22269 Keep track of some hooks used by the primary repository 2010-01-22 19:00:14 -08:00