git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path
@ 2013-06-15 23:01 Dennis Kaarsemaker
  2013-06-17 20:06 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Dennis Kaarsemaker @ 2013-06-15 23:01 UTC (permalink / raw)
  To: git

make and make test both work when $GIT_DIR isn't .git, but make dist
included a bogus GIT-VERSION-FILE.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
---
 I'm doing daily builds of git, using many workers and a shared git.git,
 with per-worker checkouts, it would be really useful if GIT-VERSION-GEN
 actually supports this and doesn't generate a fairly bogus
 GIT-VERSION-FILE.

 GIT-VERSION-GEN | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 390782f..7dcca28 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -11,7 +11,7 @@ LF='
 if test -f version
 then
 	VN=$(cat version) || VN="$DEF_VER"
-elif test -d .git -o -f .git &&
+elif test -d .git -o -f .git -o test -d $GIT_DIR &&
 	VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
-- 
1.8.2.4.g940421e

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path
  2013-06-15 23:01 [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path Dennis Kaarsemaker
@ 2013-06-17 20:06 ` Junio C Hamano
  2013-06-17 20:09   ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2013-06-17 20:06 UTC (permalink / raw)
  To: Dennis Kaarsemaker; +Cc: git

Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:

>  I'm doing daily builds of git, using many workers and a shared git.git,
>  with per-worker checkouts

OK, so GIT_DIR is explicitly specified in these "workers".

Makes sense.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path
  2013-06-17 20:06 ` Junio C Hamano
@ 2013-06-17 20:09   ` Junio C Hamano
  2013-06-18  7:20     ` Dennis Kaarsemaker
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2013-06-17 20:09 UTC (permalink / raw)
  To: Dennis Kaarsemaker; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
>
>>  I'm doing daily builds of git, using many workers and a shared git.git,
>>  with per-worker checkouts
>
> OK, so GIT_DIR is explicitly specified in these "workers".
>
> Makes sense.

Actually it does not.  What if GIT_DIR is an empty string or not set
at all?  The patch breaks the build for everybody else, doesn't it?

Perhaps like this instead?

 GIT-VERSION-GEN | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 2908204..91ec831 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -11,7 +11,7 @@ LF='
 if test -f version
 then
 	VN=$(cat version) || VN="$DEF_VER"
-elif test -d .git -o -f .git &&
+elif test -d ${GIT_DIR:-.git} -o -f .git &&
 	VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path
  2013-06-17 20:09   ` Junio C Hamano
@ 2013-06-18  7:20     ` Dennis Kaarsemaker
  2013-06-18 14:36       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Dennis Kaarsemaker @ 2013-06-18  7:20 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

On ma, 2013-06-17 at 13:09 -0700, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
> >
> >>  I'm doing daily builds of git, using many workers and a shared git.git,
> >>  with per-worker checkouts
> >
> > OK, so GIT_DIR is explicitly specified in these "workers".

Yes, both GIT_DIR and GIT_WORK_TREE are set and the use of .git/HEAD and
anything relying on it is shunned, so workers can run checkout as they
please.

> > Makes sense.
>
> Actually it does not.  What if GIT_DIR is an empty string or not set
> at all?  The patch breaks the build for everybody else, doesn't it?

It does indeed, I only tested in my setup and not with a normal make
test. Apologies.

> Perhaps like this instead?
>
>  GIT-VERSION-GEN | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
> index 2908204..91ec831 100755
> --- a/GIT-VERSION-GEN
> +++ b/GIT-VERSION-GEN
> @@ -11,7 +11,7 @@ LF='
>  if test -f version
>  then
>  	VN=$(cat version) || VN="$DEF_VER"
> -elif test -d .git -o -f .git &&
> +elif test -d ${GIT_DIR:-.git} -o -f .git &&
>  	VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
>  	case "$VN" in
>  	*$LF*) (exit 1) ;;

Yes, that makes a lot more sense and actually works in normal make test
and with a detached .git. Do you want me to send an updated patch?

-- 
Dennis Kaarsemaker
www.kaarsemaker.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path
  2013-06-18  7:20     ` Dennis Kaarsemaker
@ 2013-06-18 14:36       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2013-06-18 14:36 UTC (permalink / raw)
  To: Dennis Kaarsemaker; +Cc: git

Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:

> On ma, 2013-06-17 at 13:09 -0700, Junio C Hamano wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>> 
>> > Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
>> >
>> >>  I'm doing daily builds of git, using many workers and a shared git.git,
>> >>  with per-worker checkouts
>> >
>> > OK, so GIT_DIR is explicitly specified in these "workers".
>
> Yes, both GIT_DIR and GIT_WORK_TREE are set and the use of .git/HEAD and
> anything relying on it is shunned, so workers can run checkout as they
> please.
>
>> > Makes sense.
>>
>> Actually it does not.  What if GIT_DIR is an empty string or not set
>> at all?  The patch breaks the build for everybody else, doesn't it?
>
> It does indeed, I only tested in my setup and not with a normal make
> test. Apologies.
>
>> Perhaps like this instead?
>>
>>  GIT-VERSION-GEN | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
>> index 2908204..91ec831 100755
>> --- a/GIT-VERSION-GEN
>> +++ b/GIT-VERSION-GEN
>> @@ -11,7 +11,7 @@ LF='
>>  if test -f version
>>  then
>>  	VN=$(cat version) || VN="$DEF_VER"
>> -elif test -d .git -o -f .git &&
>> +elif test -d ${GIT_DIR:-.git} -o -f .git &&
>>  	VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
>>  	case "$VN" in
>>  	*$LF*) (exit 1) ;;
>
> Yes, that makes a lot more sense and actually works in normal make test
> and with a detached .git. Do you want me to send an updated patch?

I think I've locally amended it already before queueing it to 'pu',
so no need to resend.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-18 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-15 23:01 [PATCH] GIT-VERSION-GEN: support non-standard $GIT_DIR path Dennis Kaarsemaker
2013-06-17 20:06 ` Junio C Hamano
2013-06-17 20:09   ` Junio C Hamano
2013-06-18  7:20     ` Dennis Kaarsemaker
2013-06-18 14:36       ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).