Junio C Hamano
76c61fbdba
log: decorate HEAD with branch name under --decorate=full, too
...
The previous step to teach "log --decorate" to show "HEAD -> master"
instead of "HEAD, master" when showing the commit at the tip of the
'master' branch, when the 'master' branch is checked out, did not
work for "log --decorate=full".
The commands in the "log" family prepare commit decorations for all
refs upfront, and the actual string used in a decoration depends on
how load_ref_decorations() is called very early in the process. By
default, "git log --decorate" stores names with common prefixes such
as "refs/heads" stripped; "git log --decorate=full" stores the full
refnames.
When the current_pointed_by_HEAD() function has to decide if "HEAD"
points at the branch a decoration describes, however, what was
passed to load_ref_decorations() to decide to strip (or keep) such a
common prefix is long lost. This makes it impossible to reliably
tell if a decoration that stores "refs/heads/master", for example,
is the 'master' branch (under "--decorate" with prefix omitted) or
'refs/heads/master' branch (under "--decorate=full").
Keep what was passed to load_ref_decorations() in a global next to
the global variable name_decoration, and use that to decide how to
match what was read from "HEAD" and what is in a decoration.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-13 10:25:18 -07:00
..
2007-07-02 21:05:45 -07:00
2006-07-01 22:02:17 -07:00
2011-02-07 15:04:30 -08:00
2011-02-07 15:04:30 -08:00
2011-04-11 11:16:15 -07:00
2009-02-20 00:02:48 -08:00
2011-04-11 10:12:24 -07:00
2008-05-24 00:16:39 -07:00
2009-01-06 23:18:20 -08:00
2008-05-24 00:16:39 -07:00
2009-02-18 10:55:33 -08:00
2006-07-01 22:02:17 -07:00
2006-07-01 22:02:17 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2006-07-01 22:02:17 -07:00
2006-07-01 22:02:17 -07:00
2008-10-12 12:36:19 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2006-07-13 21:40:43 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2006-06-29 12:07:27 -07:00
2006-10-05 15:10:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-07-13 21:40:43 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2006-07-13 21:40:43 -07:00
2006-07-13 21:40:43 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2015-03-10 15:17:48 -07:00
2015-05-13 10:25:18 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2009-02-13 17:18:22 -08:00
2009-02-13 17:18:22 -08:00
2010-08-31 14:30:29 -07:00
2010-08-31 14:30:29 -07:00
2010-08-31 14:30:29 -07:00
2010-03-09 01:11:18 -08:00
2010-03-09 01:11:18 -08:00
2010-03-09 01:11:18 -08:00
2009-02-13 17:18:22 -08:00
2010-08-06 09:14:22 -07:00
2006-07-13 21:40:43 -07:00
2007-10-15 20:24:27 -04:00
2011-03-09 14:28:24 -08:00
2011-03-09 14:28:24 -08:00
2011-03-09 14:28:24 -08:00
2009-02-13 17:18:22 -08:00
2009-02-20 00:02:48 -08:00
2009-02-20 00:02:48 -08:00
2010-03-09 01:11:19 -08:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2010-03-09 01:11:18 -08:00
2010-03-09 01:11:19 -08:00
2006-06-26 14:36:40 -07:00
2009-02-13 17:18:22 -08:00
2006-06-26 14:36:40 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2012-04-30 14:17:26 -07:00
2006-07-13 21:40:43 -07:00
2006-07-13 21:40:43 -07:00
2006-07-13 21:40:43 -07:00
2006-07-13 21:40:43 -07:00
2006-07-13 21:40:43 -07:00
2006-07-13 21:40:43 -07:00