git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] rev-parse: honor --quiet when asking for reflog dates that do not exist

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 18, 2014, 16:07 UTC
Message-ID
<xmqqr3z8q5dw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1410928530-21595-2-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 6 quoted lines
> Subject: Re: [PATCH 2/2] rev-parse: honor --quiet when asking for reflog dates that do not exist
> ...
> Make rev-parse --verify --quiet ref@{1.year.ago} when the reflog
> does not go back that far succeed silently with --quiet.
> ...
> +test_expect_success 'succeeds silently when using -q with invalid dates' '

These phrases may invite confusion and misunderstanding. These dates on which you do not know where the tip of the ref was are not necessarily "do not exist", "does not go back that far", or "invalid".

You may have pruned old entries for a long running branch. It is just you no longer have records that go that far enough.

We would be able to tell two cases apart if we really wanted to by looking at the oldest reflog entry. If it records a creation of the ref, then the ref did not exist back then and the reflog does not go back that far. It may not be a bad idea to turn the current warning to an error in that case. And if the oldest entry knows where the ref used to point at, then we have expired older entries. We can continue giving the "oldest known" as before with a warning.

But that would be a separate issue.
Show 12 quoted lines
> +	ref=$(git rev-parse HEAD) &&
> +	: >.git/logs/refs/test3 &&
> +	git update-ref -m "message for refs/test3" refs/test3 "$ref" &&
> +	git rev-parse -q --verify refs/test3@{1.year.ago} >actual 2>error &&
> +	test_must_be_empty error &&
> +	echo "$ref" >expect &&
> +	test_cmp expect actual
> +'
> +
>  test_expect_success 'no stdout output on error' '
>  	test -z "$(git rev-parse --verify)" &&
>  	test -z "$(git rev-parse --verify foo)" &&
Previous: David AguilarNext: Junio C Hamano
Message 3 of 5 in “fixup! refs: make rev-parse --quiet actually quiet”
  1. 1/2 fixup! refs: make rev-parse --quiet actually quietDavid Aguilar, Sep 17, 2014
  2. 2/2 rev-parse: honor --quiet when asking for reflog dates that do not existDavid Aguilar, Sep 17, 2014
  3. Junio C HamanoSep 18, 2014
  4. Junio C HamanoSep 18, 2014
  5. David AguilarSep 19, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.