If I run Cygwin git directly from cmd.exe instead of from a shell,
e.g. bash, I get the following error when executing git repack
FIND: Parameter format not correct
that's because in git-repack.sh, 'find' is called without its full
path, this patch corrects this
Signed-off-by: ryenus <redacted>
---
git-repack.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -64,7 +64,7 @@ case ",$all_into_one," in ,t,)args=existing=if[-d"$PACKDIR"];then-forein`cd"$PACKDIR"&&find.-typef-name'*.pack'\+forein`cd"$PACKDIR"&&/usr/bin/find.-typef-name'*.pack'\|sed-e's/^\.\///'-e's/\.pack$//'`doif[-e"$PACKDIR/$e.keep"];then--
From: René Scharfe <hidden> Date: 2016-06-15 22:50:49
Am 19.03.2011 13:18, schrieb Nguyen Thai Ngoc Duy:
On Sat, Mar 19, 2011 at 7:08 PM, ryenus ◇[off-list ref] wrote:
quoted
- for e in `cd "$PACKDIR"&& find . -type f -name '*.pack' \
+ for e in `cd "$PACKDIR"&& /usr/bin/find . -type f
I'd rather have something like in test-lib.sh (with conditions)
find() {
/usr/bin/find "$@"
}
Even better, rewrite this script to C.
That's a good idea, but it's a lot more involved than the original
patch.
Do we need to support pack files in subdirectories of $PACKDIR? If
not -- and I don't immediately see why, except that the current code
does with its find call -- then the following patch might be a quick
bandaid. Untested, please be careful.
René
git-repack.sh | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
@@ -64,15 +64,16 @@ case ",$all_into_one," in ,t,)args=existing=if[-d"$PACKDIR"];then-forein`cd"$PACKDIR"&&find.-typef-name'*.pack'\-|sed-e's/^\.\///'-e's/\.pack$//'`-do-if[-e"$PACKDIR/$e.keep"];then-:keep-else-existing="$existing$e"-fi-done+existing=$(+cd"$PACKDIR"&&+forein*.pack+do+iftest-f"$e"-a!-e"${e%.pack}.keep"+then+echo"${e%.pack}"+fi+done+)iftest-n"$existing"-a-n"$unpack_unreachable"-a\-n"$remove_redundant"then
On Sat, Mar 19, 2011 at 04:50:24PM +0100, René Scharfe wrote:
Do we need to support pack files in subdirectories of $PACKDIR? If
not -- and I don't immediately see why, except that the current code
does with its find call -- then the following patch might be a quick
bandaid. Untested, please be careful.
I looked at test-lib.sh but forgot git-sh-setup.sh, which does
aliasing for find in MINGW build. With your patch, the last use of
find is gone. So we might as well do this
On Sat, Mar 19, 2011 at 11:07 PM, Nguyen Thai Ngoc Duy
[off-list ref] wrote:
I looked at test-lib.sh but forgot git-sh-setup.sh, which does
aliasing for find in MINGW build. With your patch, the last use of
find is gone. So we might as well do this
- find () {
- /usr/bin/find "$@"
- }
On second thought, no. We probably need to do an unconditional alias
find() {
die "find is not supported"
}
to make sure no one will ever use it again.
--
Duy
Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,
in the bottom, sort and find are defined as functions like what you
pointed out, but only for MinGW, therefore a better fix is to check
for cygwin as well:
---
git-sh-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -227,7 +227,7 @@ fi# Fix some commands on Windowscase$(uname-s)in-*MINGW*)+*MINGW*|*CYGWIN*)# Windows has its own (incompatible) sort and findsort(){/usr/bin/sort"$@"--
OK, I've been away for a while and didn't notice latest replies :-) do
you mean find is not used elsewhere in git?
Anyway, looks like checking for both MinGW and Cygwin still applies.
Thanks
On Sun, Mar 20, 2011 at 00:32, ryenus ◇ [off-list ref] wrote:
quoted hunk
Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,
in the bottom, sort and find are defined as functions like what you
pointed out, but only for MinGW, therefore a better fix is to check
for cygwin as well:
---
git-sh-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
# Fix some commands on Windows
case $(uname -s) in
-*MINGW*)
+*MINGW*|*CYGWIN*)
# Windows has its own (incompatible) sort and find
sort () {
/usr/bin/sort "$@"
--
1.7.4
On Sat, Mar 19, 2011 at 11:43 PM, ryenus ◇ [off-list ref] wrote:
OK, I've been away for a while and didn't notice latest replies :-) do
you mean find is not used elsewhere in git?
That's what 'git grep find *.sh' told me. Anyway I suppose our
testsuites cover all commands quite good so we would notice if any
other commands still use 'find'.
Anyway, looks like checking for both MinGW and Cygwin still applies.
I don't use cygwin so I don't know if cygwin users are happy with
that. But it looks ok (unless some users decide to move find to
another place)
--
Duy