Re: [RFC] describe: add option --dirty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Mon, 23 Jul 2007 03:08:18 -0400,
Shawn O. Pearce wrote:
> 
> Junio C Hamano <gitster@xxxxxxxxx> wrote:
> > Yasushi SHOJI <yashi@xxxxxxxxxxxxxxxxx> writes:
> > 
> > > when --dirty is given, git describe will check the working tree and
> > > append "-dirty" to describe string if the tree is dirty.
> > > ---
> > > I'm not sure this is good idea or the current way (using diff-index in
> > > shell script) is more prefered.
> > 
> > Hmph, this makes sense _ONLY_ for HEAD, doesn't it?
> > 
> > IOW, what should this output?
> > 
> > 	$ git checkout v1.5.0 ;# detached HEAD
> >         $ git reset --hard  ;# clean slate
> >         $ echo >>Makefile ;# not anymore
> >         $ git describe --dirty v1.4.0^1
> > 
> > Should it say "v1.4.0-rc2-156-g0a8f4f0-dirty"?  The dirtiness
> > does not have anything to do with commit v1.4.0^1, so...
> 
> Good catch.  I had that in my mind when I was reading the patch,
> but failed to mention it.  I blame metze on #git, he interrupted
> my train of thought.  ;-)

I knew the issue be failed to note about it.  Thanks.

> I think the answer is the user passes either --dirty OR one or
> more commit-ish.  But not --dirty and a commit-ish.  In other words
> you can either describe the working directory state, or a commit,
> but not both at once.  Which also neatly solves my issue with
> diff-index running more than once.

So the point is would it be worth implementing in usable form?

>From the comments I'd add an option "--workinig-tree" instead of
--dirty to describe the working tree.  because that, the special case,
is what we want after all,

synopsis would be:

	SYNOPSIS
	--------
	'git-describe' [--all] [--tags] [--contains] [--abbrev=<n>]
	               [--candidates=<n>] [--debug]
	               --working-tree | <committish>...
	    :
	    :
	--working-tree::
		Describe the working tree instead of committishes.  if the
		working tree is dirty, the describe string will have "-dirty"
		appended.
	
		As you can assume from the name, this option requires working
		tree; running it on a bare repository will fail.

what do you think?
-- 
         yashi
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux