Git development
 help / color / mirror / Atom feed
* [PATCH]: git-merge-one-file-script use /usr/bin/env to call bash
@ 2005-05-07  8:45 Thomas Glanzmann
  2005-05-07  8:52 ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Glanzmann @ 2005-05-07  8:45 UTC (permalink / raw)
  To: Linus Torvalds, GIT

[PATCH]: git-merge-one-file-script use /usr/bin/env to call bash

Signed-Off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>

--- a/git-merge-one-file-script
+++ b/git-merge-one-file-script
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 #
 # This is the git merge script, called with
 #

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

* Re: [PATCH]: git-merge-one-file-script use /usr/bin/env to call bash
  2005-05-07  8:45 [PATCH]: git-merge-one-file-script use /usr/bin/env to call bash Thomas Glanzmann
@ 2005-05-07  8:52 ` Junio C Hamano
  2005-05-07  9:05   ` [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility Thomas Glanzmann
  0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2005-05-07  8:52 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: GIT

A quick question.  Which construct in this bashism?
Not using backtick but saying $(command)?


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

* [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07  8:52 ` Junio C Hamano
@ 2005-05-07  9:05   ` Thomas Glanzmann
  2005-05-07 10:03     ` bert hubert
  2005-05-07 17:24     ` Martin Waitz
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Glanzmann @ 2005-05-07  9:05 UTC (permalink / raw)
  To: GIT; +Cc: Junio C Hamano

Hello,

* Junio C Hamano <junkio@cox.net> [050507 10:54]:
> A quick question.  Which construct in this bashism?
> Not using backtick but saying $(command)?

Exactly:

	(faui04a) [~/work/git/git-solaris] git pull
	head => 46dd99f970d283dc0de440c06fca8f4586b70548
	remote => e7d3dd248f50501f98b29c917e70bddcf3ea925a
	base => 74c7cfa875448c71a18d21a0cc7c973afe759fa5
	Documentation/core-git.txt: unmerged (8bd893197e6e769b6e03ca1206e355214e16d56a)
	local-pull.c: unmerged (4f52bca48c390e8113b3695a53ce62e0c23278a8)
	local-pull.c: unmerged (a8af725467cde6653160511e468a1fda4e004503)
	local-pull.c: unmerged (1eec8927dbfa3af934651b25ded738d192706286)
	sha1_file.c: unmerged (e6ce455ae90bd430f2128f454bdb6e0575412486)
	sha1_file.c: unmerged (7887b6481ae5c9368a24bf053f79dbbc1f039300)
	sha1_file.c: unmerged (f1c1c70d784aa0587cd4c7143c3d464fd8e5ddc6)
	fatal: write-tree: not able to write tree

This is it:
	/home/cip/adm/sithglan/work/git/bin/git-SunOS/bin/git-merge-one-file-script: syntax error at line 55: `orig=$' unexpected
	fatal: merge program failed
	git-merge-cache failed: child exit value: 1 at /home/cip/adm/sithglan/work/git/yagf/git line 1015.

The attached patch at the end of this eMail fixes it for me *without*
touching /bin/sh in the bang:

	(faui04a) [~/work/git/git-solaris] git pull
	head => 46dd99f970d283dc0de440c06fca8f4586b70548
	remote => e7d3dd248f50501f98b29c917e70bddcf3ea925a
	base => 74c7cfa875448c71a18d21a0cc7c973afe759fa5
	Documentation/core-git.txt: unmerged (8bd893197e6e769b6e03ca1206e355214e16d56a)
	local-pull.c: unmerged (4f52bca48c390e8113b3695a53ce62e0c23278a8)
	local-pull.c: unmerged (a8af725467cde6653160511e468a1fda4e004503)
	local-pull.c: unmerged (1eec8927dbfa3af934651b25ded738d192706286)
	sha1_file.c: unmerged (e6ce455ae90bd430f2128f454bdb6e0575412486)
	sha1_file.c: unmerged (7887b6481ae5c9368a24bf053f79dbbc1f039300)
	sha1_file.c: unmerged (f1c1c70d784aa0587cd4c7143c3d464fd8e5ddc6)
	fatal: write-tree: not able to write tree
	Threewaydiff invloved.

[PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility

Signed-Off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>

--- a/git-merge-one-file-script
+++ b/git-merge-one-file-script
@@ -52,9 +52,9 @@
 #
 "$1$2$3")
 	echo "Auto-merging $4."
-	orig=$(git-unpack-file $1)
-	src1=$(git-unpack-file $2)
-	src2=$(git-unpack-file $3)
+	orig=`git-unpack-file $1`
+	src1=`git-unpack-file $2`
+	src2=`git-unpack-file $3`
 	merge "$src2" "$orig" "$src1"
 	ret=$?
 	if [ "$6" != "$7" ]; then
@@ -64,7 +64,7 @@
 		echo "ERROR: Leaving conflict merge in $src2."
 		exit 1
 	fi
-	sha1=$(git-write-blob "$src2") || {
+	sha1=`git-write-blob "$src2"` || {
 		echo "ERROR: Leaving conflict merge in $src2."
 	}
 	exec git-update-cache --add --cacheinfo "$6" $sha1 "$4" ;;

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07  9:05   ` [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility Thomas Glanzmann
@ 2005-05-07 10:03     ` bert hubert
  2005-05-07 10:15       ` Thomas Glanzmann
  2005-05-07 17:24     ` Martin Waitz
  1 sibling, 1 reply; 11+ messages in thread
From: bert hubert @ 2005-05-07 10:03 UTC (permalink / raw)
  To: GIT, Junio C Hamano

On Sat, May 07, 2005 at 11:05:43AM +0200, Thomas Glanzmann wrote:
> * Junio C Hamano <junkio@cox.net> [050507 10:54]:
> > A quick question.  Which construct in this bashism?
> > Not using backtick but saying $(command)?

You can nest $() which is valuable, unlike backtics.

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07 10:03     ` bert hubert
@ 2005-05-07 10:15       ` Thomas Glanzmann
  2005-05-07 18:38         ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Glanzmann @ 2005-05-07 10:15 UTC (permalink / raw)
  To: GIT

Hello,

> You can nest $() which is valuable, unlike backtics.

we're aware of this. But the specific script works perfectly fine
without nested simple-command redirection. So what is your point?

	Thomas

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07  9:05   ` [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility Thomas Glanzmann
  2005-05-07 10:03     ` bert hubert
@ 2005-05-07 17:24     ` Martin Waitz
  2005-05-07 20:22       ` Morten Welinder
  2005-05-07 23:15       ` Thomas Glanzmann
  1 sibling, 2 replies; 11+ messages in thread
From: Martin Waitz @ 2005-05-07 17:24 UTC (permalink / raw)
  To: GIT, Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

hoi :)

On Sat, May 07, 2005 at 11:05:43AM +0200, Thomas Glanzmann wrote:
> * Junio C Hamano <junkio@cox.net> [050507 10:54]:
> > A quick question.  Which construct in this bashism?
> > Not using backtick but saying $(command)?
> 
> Exactly:

huh? which broken shell does not understand $()?

-- 
Martin Waitz

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07 10:15       ` Thomas Glanzmann
@ 2005-05-07 18:38         ` Junio C Hamano
  2005-05-07 23:15           ` Thomas Glanzmann
  0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2005-05-07 18:38 UTC (permalink / raw)
  To: GIT

>>>>> "TG" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:

TG> Hello,
>> You can nest $() which is valuable, unlike backtics.

TG> we're aware of this. But the specific script works perfectly fine
TG> without nested simple-command redirection. So what is your point?

If that is the case then I think the patch you posted to force
bash is backwards.  How about changing it to use backticks?


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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07 17:24     ` Martin Waitz
@ 2005-05-07 20:22       ` Morten Welinder
  2005-05-07 23:15       ` Thomas Glanzmann
  1 sibling, 0 replies; 11+ messages in thread
From: Morten Welinder @ 2005-05-07 20:22 UTC (permalink / raw)
  To: Martin Waitz; +Cc: GIT, Junio C Hamano

On 5/7/05, Martin Waitz <tali@admingilde.org> wrote:
> hoi :)
> 
> On Sat, May 07, 2005 at 11:05:43AM +0200, Thomas Glanzmann wrote:
> > * Junio C Hamano <junkio@cox.net> [050507 10:54]:
> > > A quick question.  Which construct in this bashism?
> > > Not using backtick but saying $(command)?
> >
> > Exactly:
> 
> huh? which broken shell does not understand $()?

Solaris' /bin/sh

I thought everything we were relying on bash anyway.  It'll take it.

Morten

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07 18:38         ` Junio C Hamano
@ 2005-05-07 23:15           ` Thomas Glanzmann
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Glanzmann @ 2005-05-07 23:15 UTC (permalink / raw)
  To: GIT

Hello,

> If that is the case then I think the patch you posted to force
> bash is backwards.  How about changing it to use backticks?

agreed. Already did that see previous eMail.

	Thomas

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07 17:24     ` Martin Waitz
  2005-05-07 20:22       ` Morten Welinder
@ 2005-05-07 23:15       ` Thomas Glanzmann
  2005-05-09 14:47         ` H. Peter Anvin
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Glanzmann @ 2005-05-07 23:15 UTC (permalink / raw)
  To: GIT

Hello Coworker,

> huh? which broken shell does not understand $()?

/bin/sh under Solaris 9 for example. That is where I hit it initial.

	Thomas

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

* Re: [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility
  2005-05-07 23:15       ` Thomas Glanzmann
@ 2005-05-09 14:47         ` H. Peter Anvin
  0 siblings, 0 replies; 11+ messages in thread
From: H. Peter Anvin @ 2005-05-09 14:47 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: GIT

Thomas Glanzmann wrote:
> Hello Coworker,
> 
> 
>>huh? which broken shell does not understand $()?
> 
> 
> /bin/sh under Solaris 9 for example. That is where I hit it initial.
> 

Shoot Sun.

$(...) is in POSIX and has been for oh, what, 15 years now?

	-hpa

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

end of thread, other threads:[~2005-05-09 14:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-07  8:45 [PATCH]: git-merge-one-file-script use /usr/bin/env to call bash Thomas Glanzmann
2005-05-07  8:52 ` Junio C Hamano
2005-05-07  9:05   ` [PATCH] Use backticks instead of $(command) to maintain /bin/sh compatibility Thomas Glanzmann
2005-05-07 10:03     ` bert hubert
2005-05-07 10:15       ` Thomas Glanzmann
2005-05-07 18:38         ` Junio C Hamano
2005-05-07 23:15           ` Thomas Glanzmann
2005-05-07 17:24     ` Martin Waitz
2005-05-07 20:22       ` Morten Welinder
2005-05-07 23:15       ` Thomas Glanzmann
2005-05-09 14:47         ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox