update-ref and tag: add --create-reflog arg
commit144c76fa39254903cb1e8e2d6d159603077356a7
authorDavid Turner <dturner@twopensource.com>
Tue, 21 Jul 2015 21:04:55 +0000 (21 17:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jul 2015 21:08:35 +0000 (21 14:08 -0700)
tree14c41558ef0aa09cb1088a2cf78b9116dbe73c0c
parent0f2a71d9923b4cf010ad0801eb71ee3666798204
update-ref and tag: add --create-reflog arg

Allow the creation of a ref (e.g. stash) with a reflog already in
place. For most refs (e.g. those under refs/heads), this happens
automatically, but for others, we need this option.

Currently, git does this by pre-creating the reflog, but alternate ref
backends might store reflogs somewhere other than .git/logs.  Code
that now directly manipulates .git/logs should instead use git
plumbing commands.

I also added --create-reflog to git tag, just for completeness.

In a moment, we will use this argument to make git stash work with
alternate ref backends.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-tag.txt
Documentation/git-update-ref.txt
builtin/tag.c
builtin/update-ref.c
t/t1400-update-ref.sh
t/t7004-tag.sh