* git-describe recognize modified files
@ 2010-01-19 9:53 tzachi perelstein
2010-01-19 10:35 ` Johannes Schindelin
0 siblings, 1 reply; 6+ messages in thread
From: tzachi perelstein @ 2010-01-19 9:53 UTC (permalink / raw)
To: git
I use git-describe to form a build version automatically. This allows me
to deliver temporary builds for testing without having to make manual
tags for them. The only thing that bothers me about this is that from
the output of git-describe I cannot tell if there are some modified
files in tree or not. In both cases I will get the same version.
To solve this issue, in addition to git-describe, my do_version script
also run git-status, and if there are "modified:" files then it
concatenates the string "+dirty" to output of git-describe. This way by
looking at the version I'm able to know whether a specific version is
valid (checkout-able) or not.
It would be nice to have this option supported in git-describe IMO. I'm willing to implement that and submit a patch for review, but I'd like to hear your opinion first.
Tzachi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git-describe recognize modified files
2010-01-19 9:53 git-describe recognize modified files tzachi perelstein
@ 2010-01-19 10:35 ` Johannes Schindelin
2010-01-19 12:21 ` Andreas Krey
2010-01-19 12:59 ` tzachi perelstein
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Schindelin @ 2010-01-19 10:35 UTC (permalink / raw)
To: tzachi perelstein; +Cc: git
Hi,
On Tue, 19 Jan 2010, tzachi perelstein wrote:
> I use git-describe to form a build version automatically. This allows me
> to deliver temporary builds for testing without having to make manual
> tags for them. The only thing that bothers me about this is that from
> the output of git-describe I cannot tell if there are some modified
> files in tree or not. In both cases I will get the same version.
>
> To solve this issue, in addition to git-describe, my do_version script
> also run git-status, and if there are "modified:" files then it
> concatenates the string "+dirty" to output of git-describe.
The problem is that this does not describe the exact version you used very
well. If you are really serious about describing the exact state you
described, make a tag (committing the changes to a detached HEAD first, if
you do not want the changes in a real branch).
Ciao,
Dscho
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git-describe recognize modified files
2010-01-19 10:35 ` Johannes Schindelin
@ 2010-01-19 12:21 ` Andreas Krey
2010-01-19 12:49 ` Jakub Narebski
2010-01-19 12:59 ` tzachi perelstein
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Krey @ 2010-01-19 12:21 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: tzachi perelstein, git
On Tue, 19 Jan 2010 11:35:41 +0000, Johannes Schindelin wrote:
...
> > To solve this issue, in addition to git-describe, my do_version script
> > also run git-status, and if there are "modified:" files then it
> > concatenates the string "+dirty" to output of git-describe.
>
> The problem is that this does not describe the exact version you used very
> well.
I (and probably the original poster) don't care that much; for me the
important information is that the binary (or whatever) was not built
from the exact committed state. Thus the question is whether the
second two lines of
BUILDINFO=git-`git describe --abbrev=16 --always HEAD 2>/dev/null`
git update-index -q --refresh
test -z "`git diff-index --name-only HEAD --`" || BUILDINFO="$BUILDINFO.dirty"
(after GIT-VERSION-GEN) are worth to be integrated into git-describe?
(And whether it should also say '.dirty'
when there are untracked files present.
Or either for submodules.)
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git-describe recognize modified files
2010-01-19 12:21 ` Andreas Krey
@ 2010-01-19 12:49 ` Jakub Narebski
2010-01-19 13:07 ` tzachi perelstein
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Narebski @ 2010-01-19 12:49 UTC (permalink / raw)
To: Andreas Krey; +Cc: Johannes Schindelin, tzachi perelstein, git
Andreas Krey <a.krey@gmx.de> writes:
> On Tue, 19 Jan 2010 11:35:41 +0000, Johannes Schindelin wrote:
> ...
> > > To solve this issue, in addition to git-describe, my do_version script
> > > also run git-status, and if there are "modified:" files then it
> > > concatenates the string "+dirty" to output of git-describe.
> >
> > The problem is that this does not describe the exact version you used very
> > well.
>
> I (and probably the original poster) don't care that much; for me the
> important information is that the binary (or whatever) was not built
> from the exact committed state. Thus the question is whether the
> second two lines of
>
> BUILDINFO=git-`git describe --abbrev=16 --always HEAD 2>/dev/null`
> git update-index -q --refresh
> test -z "`git diff-index --name-only HEAD --`" || BUILDINFO="$BUILDINFO.dirty"
>
> (after GIT-VERSION-GEN) are worth to be integrated into git-describe?
>
> (And whether it should also say '.dirty'
> when there are untracked files present.
> Or either for submodules.)
FYI it is integrated in git-describe since
9f67d2e (Teach "git describe" --dirty option, 2009-10-21)
by Jean Privat (it should be present in 1.6.6, IIRC).
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git-describe recognize modified files
2010-01-19 10:35 ` Johannes Schindelin
2010-01-19 12:21 ` Andreas Krey
@ 2010-01-19 12:59 ` tzachi perelstein
1 sibling, 0 replies; 6+ messages in thread
From: tzachi perelstein @ 2010-01-19 12:59 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
> From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> To: tzachi perelstein <tzachi_perelstein@yahoo.com>
> Cc: git@vger.kernel.org
> Sent: Tue, January 19, 2010 12:35:41 PM
> Subject: Re: git-describe recognize modified files
>
> Hi,
>
> On Tue, 19 Jan 2010, tzachi perelstein wrote:
>
> > I use git-describe to form a build version automatically. This allows me
> > to deliver temporary builds for testing without having to make manual
> > tags for them. The only thing that bothers me about this is that from
> > the output of git-describe I cannot tell if there are some modified
> > files in tree or not. In both cases I will get the same version.
> >
> > To solve this issue, in addition to git-describe, my do_version script
> > also run git-status, and if there are "modified:" files then it
> > concatenates the string "+dirty" to output of git-describe.
>
> The problem is that this does not describe the exact version you used very
> well. If you are really serious about describing the exact state you
> described, make a tag (committing the changes to a detached HEAD first, if
> you do not want the changes in a real branch).
>
Well yes, this is valid, but you will end up with a tag for every build... this goes way too far.
Consider the case where you have no modified files in your tree. The output of git-describe at some given point is 'v1.0.0-2-g123457' and during the build it becomes the build version. Now you make some changes, but before committing them you build, install, and run a test. During the second build, the output of git-describe remains the same 'v1.0.0-2-g123457' although it represent two different trees. This behavior looks like somewhat incomplete to me. It sounds reasonable to me to let git-describe have the option of indicating about modified files in tree, say 'v1.0.0-2-g123457-modified' or something similar. While 'v1.0.0-2-g123457' is something you and git can refer to (i.e. checkout), 'v1.0.0-2-g123457-modified' is not. By adding the "-modified" string, git tells you explicitly that it cannot fully describe the exact tree you're using.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git-describe recognize modified files
2010-01-19 12:49 ` Jakub Narebski
@ 2010-01-19 13:07 ` tzachi perelstein
0 siblings, 0 replies; 6+ messages in thread
From: tzachi perelstein @ 2010-01-19 13:07 UTC (permalink / raw)
To: Jakub Narebski, Andreas Krey; +Cc: Johannes Schindelin, git
> FYI it is integrated in git-describe since
>
> 9f67d2e (Teach "git describe" --dirty option, 2009-10-21)
>
> by Jean Privat (it should be present in 1.6.6, IIRC).
>
Good news :)
Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-19 13:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19 9:53 git-describe recognize modified files tzachi perelstein
2010-01-19 10:35 ` Johannes Schindelin
2010-01-19 12:21 ` Andreas Krey
2010-01-19 12:49 ` Jakub Narebski
2010-01-19 13:07 ` tzachi perelstein
2010-01-19 12:59 ` tzachi perelstein
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).