git-commit-vandalism/builtin
Jeff King a2e7b04c44 rev-parse: fix parent shorthands with --symbolic
The try_parent_shorthands() function shows each parent via
show_rev(). We pass the correct parent sha1, but our "name"
parameter still points at the original refname. So asking
for a regular rev-parse works fine (it prints the sha1s),
but asking for the symbolic name gives nonsense like:

    $ git rev-parse --symbolic HEAD^-1
    HEAD
    ^HEAD

which is always an empty set of commits. Asking for "^!" is
likewise broken, with the added bonus that its prints ^HEAD
for _each_ parent. And "^@" just prints HEAD repeatedly.

Arguably it would be correct to just pass NULL as the name
here, and always get the parent expressed as a sha1. The
"--symbolic" documentaton claims only "as close to the
original input as possible", and we certainly fallback to
sha1s where necessary. But it's pretty easy to generate a
symbolic name on the fly from the original.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-16 11:12:15 -08:00
..
add.c add: modify already added files when --chmod is given 2016-09-15 12:13:54 -07:00
am.c Merge branch 'bc/object-id' 2016-09-19 13:47:19 -07:00
annotate.c
apply.c Convert read_mmblob to take struct object_id. 2016-09-07 12:59:42 -07:00
archive.c
bisect--helper.c
blame.c Merge branch 'mh/diff-indent-heuristic' 2016-09-26 16:09:16 -07:00
branch.c i18n: branch: mark option description for translation 2016-09-15 13:17:32 -07:00
bundle.c
cat-file.c sha1_array: let callbacks interrupt iteration 2016-09-26 11:46:41 -07:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout-index.c introduce CHECKOUT_INIT 2016-09-22 13:42:18 -07:00
checkout.c Merge branch 'rs/checkout-init-macro' 2016-09-26 16:09:21 -07:00
clean.c
clone.c Merge branch 'nd/init-core-worktree-in-multi-worktree-world' 2016-10-03 13:30:35 -07:00
column.c
commit-tree.c builtin/commit-tree: convert to struct object_id 2016-09-07 12:59:43 -07:00
commit.c Merge branch 'tg/add-chmod+x-fix' 2016-09-26 16:09:20 -07:00
config.c i18n: config: mark error message for translation 2016-09-15 13:17:32 -07:00
count-objects.c
credential.c
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c Merge branch 'jk/setup-sequence-update' 2016-09-21 15:15:24 -07:00
fast-export.c diff: convert struct diff_filespec to struct object_id 2016-06-28 11:39:02 -07:00
fetch-pack.c
fetch.c Merge branch 'jk/push-progress' 2016-08-03 15:10:28 -07:00
fmt-merge-msg.c use strbuf_addstr() for adding constant strings to a strbuf, part 2 2016-09-15 12:23:38 -07:00
for-each-ref.c
fsck.c streaming: make stream_blob_to_fd take struct object_id 2016-09-07 12:59:42 -07:00
gc.c Merge branch 'jk/reduce-gc-aggressive-depth' 2016-09-21 15:15:30 -07:00
get-tar-commit-id.c
grep.c cache: convert struct cache_entry to use struct object_id 2016-09-07 12:59:42 -07:00
hash-object.c hash-object: always try to set up the git repository 2016-09-13 15:45:45 -07:00
help.c help: introduce option --exclude-guides 2016-08-30 16:09:41 -07:00
index-pack.c index-pack: add --max-input-size=<size> option 2016-08-24 12:31:05 -07:00
init-db.c Merge branch 'nd/init-core-worktree-in-multi-worktree-world' 2016-10-03 13:30:35 -07:00
interpret-trailers.c
log.c Merge branch 'jt/format-patch-rfc' 2016-09-26 16:09:17 -07:00
ls-files.c cache: convert struct cache_entry to use struct object_id 2016-09-07 12:59:42 -07:00
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c mailsplit: support unescaping mboxrd messages 2016-06-06 11:14:43 -07:00
merge-base.c
merge-file.c
merge-index.c cache: convert struct cache_entry to use struct object_id 2016-09-07 12:59:42 -07:00
merge-ours.c
merge-recursive.c i18n: merge-recursive: mark verbose message for translation 2016-09-15 13:17:32 -07:00
merge-tree.c
merge.c use strbuf_addstr() for adding constant strings to a strbuf, part 2 2016-09-15 12:23:38 -07:00
mktag.c
mktree.c
mv.c Merge branch 'rs/copy-array' 2016-10-03 13:30:33 -07:00
name-rev.c
notes.c notes: spell first word of error messages in lowercase 2016-09-15 13:17:32 -07:00
pack-objects.c Merge branch 'ks/pack-objects-bitmap' 2016-09-21 15:15:21 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c Merge branch 'va/i18n-even-more' 2016-07-13 11:24:10 -07:00
push.c push: accept push options 2016-07-14 15:50:41 -07:00
read-tree.c cache: convert struct cache_entry to use struct object_id 2016-09-07 12:59:42 -07:00
receive-pack.c sha1_array: let callbacks interrupt iteration 2016-09-26 11:46:41 -07:00
reflog.c
remote-ext.c
remote-fd.c
remote.c Merge branch 'mh/ref-iterators' 2016-07-25 14:13:33 -07:00
repack.c Merge branch 'va/i18n-even-more' 2016-07-13 11:24:10 -07:00
replace.c
rerere.c
reset.c builtin/reset: convert to use struct object_id 2016-09-07 12:59:43 -07:00
rev-list.c graph: add support for --line-prefix on all graph-aware output 2016-08-31 18:07:09 -07:00
rev-parse.c rev-parse: fix parent shorthands with --symbolic 2016-11-16 11:12:15 -08:00
revert.c parse_options: allocate a new array when concatenating 2016-07-06 10:11:08 -07:00
rm.c builtin/rm: convert to use struct object_id 2016-09-07 12:59:42 -07:00
send-pack.c
shortlog.c Merge branch 'js/log-to-diffopt-file' 2016-07-19 13:22:15 -07:00
show-branch.c i18n: show-branch: mark plural strings for translation 2016-09-15 13:17:32 -07:00
show-ref.c
stripspace.c
submodule--helper.c Merge branch 'jk/clone-recursive-progress' 2016-09-26 16:09:22 -07:00
symbolic-ref.c symbolic-ref -d: do not allow removal of HEAD 2016-09-02 09:01:38 -07:00
tag.c
unpack-file.c
unpack-objects.c unpack-objects: add --max-input-size=<size> option 2016-08-24 12:31:05 -07:00
update-index.c Merge branch 'tg/add-chmod+x-fix' 2016-09-26 16:09:20 -07:00
update-ref.c tag, update-ref: improve description of option "create-reflog" 2015-09-11 09:50:02 -07:00
update-server-info.c
upload-archive.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c worktree: honor configuration variables 2016-09-27 10:51:33 -07:00
write-tree.c