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

Re: [PATCH v3] new --dirty option for git describe

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2009, 22:07 UTC
Message-ID
<7v63a81jvk.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1256132122-12509-1-git-send-email-jean@pryen.org>

Thanks. I'll queue it to 'pu' after minor reformatting and typofixes to the log message.

Show 10 quoted lines
> 3 Use --dirty as in this patch
> ...
> Pro: has an easy fallback to alternative 1 if the world become suddenly
>      ideal, or at least allows some kind of future transition plan if
>      people *really* bother:
>      1- ask that scripts use either "git describe HEAD" or
>         "git describe --dirty" (no more "git describe")
>      2- change default
>      Once the transition is done, the role of the --dirty option will
>      just be the way to specify an alternative mark (and a noop if alone)

Also I'd drop this as a Pro specific to #3. It is clear that the first one is incompatible from the beginning and there is no "smooth migration path" possible; also I think the second one can be migrated equally well in exactly the same way, so this is not an advantage specific to #3.

Show 21 quoted lines
> diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
> index 8c7e081..e061177 100755
> --- a/t/t6120-describe.sh
> +++ b/t/t6120-describe.sh
> @@ -123,6 +123,20 @@ test_expect_success 'rename tag Q back to A' '
>  test_expect_success 'pack tag refs' 'git pack-refs'
>  check_describe A-* HEAD
>  
> +check_describe "A-*[0-9a-f]" --dirty
> +
> +test_expect_success 'set-up dirty working tree' '
> +	echo >>file
> +'
> +
> +check_describe "A-*[0-9a-f]-dirty" --dirty
> +
> +check_describe "A-*[0-9a-f].mod" --dirty=.mod
> +
> +test_expect_success 'describe --dirty HEAD' '
> +	test_must_fail git describe --dirty HEAD
> +'

"clean work tree gets no marks; dirty work tree gets expected marks with or without the mark string; the option is incompatible with an explicit rev". Nicely covers all cases. Good job.

Previous: Jean Privat
Message 2 of 2 in “new --dirty option for git describe”
  1. new --dirty option for git describeJean Privat, Oct 21, 2009
  2. Junio C HamanoOct 21, 2009

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.