From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: [RFC] describe: add option --dirty Date: Mon, 23 Jul 2007 16:54:10 +0900 Message-ID: <87lkd7mu71.wl@mail2.atmark-techno.com> References: <87odi3mxtl.wl@mail2.atmark-techno.com> <7vsl7fmwud.fsf@assigned-by-dhcp.cox.net> <20070723070818.GI32566@spearce.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Cc: Junio C Hamano , git@vger.kernel.org To: "Shawn O. Pearce" X-From: git-owner@vger.kernel.org Mon Jul 23 09:54:27 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1ICskM-0001V4-Qe for gcvg-git@gmane.org; Mon, 23 Jul 2007 09:54:27 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753798AbXGWHyN (ORCPT ); Mon, 23 Jul 2007 03:54:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753556AbXGWHyM (ORCPT ); Mon, 23 Jul 2007 03:54:12 -0400 Received: from mail2.atmark-techno.com ([210.191.215.173]:40650 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbXGWHyM convert rfc822-to-8bit (ORCPT ); Mon, 23 Jul 2007 03:54:12 -0400 Received: from wat.atmark-techno.com.atmark-techno.com (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id 310B8547F5; Mon, 23 Jul 2007 16:54:10 +0900 (JST) In-Reply-To: <20070723070818.GI32566@spearce.org> User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: At Mon, 23 Jul 2007 03:08:18 -0400, Shawn O. Pearce wrote: > > Junio C Hamano wrote: > > Yasushi SHOJI 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=] [--candidates=] [--debug] --working-tree | ... : : --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