git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Ping Yin <pkufranky@gmail.com>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: Re* [PATCH] git-submodule: Don't blame when git-describe fails
Date: Sun, 2 Mar 2008 17:41:52 -0500	[thread overview]
Message-ID: <20080302224152.GC8410@spearce.org> (raw)
In-Reply-To: <7vy791oyqa.fsf@gitster.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> wrote:
> -- >8 --
> describe --always: fall back to showing an abbreviated object name
...
> diff --git a/builtin-describe.c b/builtin-describe.c
> index 05e309f..c1182a3 100644
> --- a/builtin-describe.c
> +++ b/builtin-describe.c
> @@ -146,6 +147,17 @@ static unsigned long finish_depth_computation(
>  	return seen_commits;
>  }
>  
> +static void cannot_describe(const unsigned char *sha1) NORETURN;
> +
> +static void cannot_describe(const unsigned char *sha1)
> +{
> +	if (always) {
> +		printf("%s\n", find_unique_abbrev(sha1, DEFAULT_ABBREV));

This should be "abbrev" not "DEFAULT_ABBREV" as then we honor the
command line "describe --always --abbrev=16" (for example).

> @@ -278,6 +290,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
>  			    "consider <n> most recent tags (default: 10)"),
>  		OPT_STRING(0, "match",       &pattern, "pattern",
>  			   "only consider tags matching <pattern>"),
> +		OPT_BOOLEAN(0, "always",     &always,
> +			   "show abbreviated commit object as fallback"),
>  		OPT_END(),
>  	};
  
Sadly I cannot come up with a better name for this option.  :-(

-- 
Shawn.

      parent reply	other threads:[~2008-03-02 22:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02 14:45 [PATCH] git-submodule: Don't blame when git-describe fails Ping Yin
2008-03-02 16:51 ` Re* " Junio C Hamano
2008-03-02 17:17   ` Ping Yin
2008-03-02 22:41   ` Shawn O. Pearce [this message]

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=20080302224152.GC8410@spearce.org \
    --to=spearce@spearce.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pkufranky@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).