All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: David Turner <dturner@twopensource.com>,
	git@vger.kernel.org, j6t@kdbg.org
Subject: Re: [PATCH v8 6/7] update-ref and tag: add --create-reflog arg
Date: Tue, 21 Jul 2015 06:46:04 -0700	[thread overview]
Message-ID: <55AE4D1C.1010308@alum.mit.edu> (raw)
In-Reply-To: <1436482260-28088-7-git-send-email-dturner@twopensource.com>

On 07/09/2015 03:50 PM, David Turner wrote:
> 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>
> ---
>  Documentation/git-tag.txt        |  5 ++++-
>  Documentation/git-update-ref.txt |  5 ++++-
>  builtin/tag.c                    |  5 ++++-
>  builtin/update-ref.c             | 14 +++++++++++---
>  t/t1400-update-ref.sh            | 38 ++++++++++++++++++++++++++++++++++++++
>  t/t7004-tag.sh                   | 14 +++++++++++++-
>  6 files changed, 74 insertions(+), 7 deletions(-)
> 
> [...]
> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
> index d1ff5c9..75423ab 100755
> --- a/t/t7004-tag.sh
> +++ b/t/t7004-tag.sh
> @@ -51,7 +51,19 @@ test_expect_success 'creating a tag using default HEAD should succeed' '
>  	echo foo >foo &&
>  	git add foo &&
>  	git commit -m Foo &&
> -	git tag mytag
> +	git tag mytag &&
> +	test_must_fail git reflog exists refs/tags/mytag
> +'
> +
> +test_expect_success 'creating a tag with --create-reflog should create reflog' '
> +	test_when_finished "git tag -d tag_with_reflog" &&
> +	git tag --create-reflog tag_with_reflog &&
> +	git reflog exists refs/tags/tag_with_reflog
> +'
> +
> +test_expect_success '--create-reflog does not creates reflog on failure' '

s/creates/create/

> +	test_must_fail git tag --create-reflog mytag &&
> +	test_must_fail git reflog exists refs/tags/tag_with_reflog

Shouldn't this be

	test_must_fail git reflog exists refs/tags/mytag

?

> [...]

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu

  reply	other threads:[~2015-07-21 13:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 22:50 [PATCH v8 0/7] ref backend preamble David Turner
2015-07-09 22:50 ` [PATCH v8 1/7] refs.c: add err arguments to reflog functions David Turner
2015-07-21 13:17   ` Michael Haggerty
2015-07-09 22:50 ` [PATCH v8 2/7] refs: Break out check for reflog autocreation David Turner
2015-07-09 22:50 ` [PATCH v8 3/7] refs: new public ref function: safe_create_reflog David Turner
2015-07-09 22:50 ` [PATCH v8 4/7] git-reflog: add exists command David Turner
2015-07-21 13:27   ` Michael Haggerty
2015-07-09 22:50 ` [PATCH v8 5/7] refs: add REF_FORCE_CREATE_REFLOG flag David Turner
2015-07-09 22:50 ` [PATCH v8 6/7] update-ref and tag: add --create-reflog arg David Turner
2015-07-21 13:46   ` Michael Haggerty [this message]
2015-07-09 22:51 ` [PATCH v8 7/7] git-stash: use update-ref --create-reflog instead of creating files David Turner
2015-07-10 14:34 ` [PATCH v8 0/7] ref backend preamble Philip Oakley
2015-07-10 17:51   ` David Turner
2015-07-21 14:02 ` Michael Haggerty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55AE4D1C.1010308@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.