git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] describe --contains / name-rev --weight
@ 2012-08-30  3:50 Junio C Hamano
  2012-08-30  3:50 ` [PATCH v2 1/6] name-rev: lose unnecessary typedef Junio C Hamano
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-08-30  3:50 UTC (permalink / raw)
  To: git

Greg KH noticed that the commit 0136db586c that was merged to the
mainline back in v3.5-rc1 days was merged again as part of a
different branch to the mainline before v3.6-rc1.

"git describe --contains" gives the commit a name based on the newer
v3.6-rc1 tag, which was surprising.

This is because "describe --contains" calls "name-rev", which tries
to use the tag that minimizes the steps between the tag and the
commit being named.  The branch merged recently to the mainline did
not have as much work done on top of the commit as the old branch
that was merged earlier, and "name-rev" chose to use the newer tag
to base the name on.

The new "--weight" option introduced by this series tells it to use
the oldest tag that contains the commit being named instead.  This
matches what people expect from "describe --contains" better.

Junio C Hamano (6):
  name-rev: lose unnecessary typedef
  name_rev: clarify the logic to assign a new tip-name to a commit
  name-rev: --weight option
  name-rev --weight: cache the computed weight in notes
  name-rev --weight: tests and documentation
  describe --contains: use "name-rev --weight"

 Documentation/git-name-rev.txt |  14 ++-
 builtin/describe.c             |   3 +-
 builtin/name-rev.c             | 195 ++++++++++++++++++++++++++++++++++++-----
 t/t6039-name-rev.sh            |  62 +++++++++++++
 4 files changed, 248 insertions(+), 26 deletions(-)
 create mode 100755 t/t6039-name-rev.sh

-- 
1.7.12.286.g9df01f7

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

end of thread, other threads:[~2012-09-04 22:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-30  3:50 [PATCH v2 0/6] describe --contains / name-rev --weight Junio C Hamano
2012-08-30  3:50 ` [PATCH v2 1/6] name-rev: lose unnecessary typedef Junio C Hamano
2012-08-30  3:50 ` [PATCH v2 2/6] name_rev: clarify the logic to assign a new tip-name to a commit Junio C Hamano
2012-08-30  3:50 ` [PATCH v2 3/6] name-rev: --weight option Junio C Hamano
2012-09-04 22:29   ` [PATCH 3.5/6] name-rev --weight: trivial optimization Junio C Hamano
2012-08-30  3:50 ` [PATCH v2 4/6] name-rev --weight: cache the computed weight in notes Junio C Hamano
2012-08-30  3:50 ` [PATCH v2 5/6] name-rev --weight: tests and documentation Junio C Hamano
2012-08-30  3:50 ` [PATCH v2 6/6] describe --contains: use "name-rev --weight" Junio C Hamano

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