* Re: git-ls-files -o no recurse?
From: Linus Torvalds @ 2006-01-05 17:31 UTC (permalink / raw)
To: Darrin Thompson; +Cc: Git Mailing List
In-Reply-To: <1136481352.5597.2.camel@localhost.localdomain>
On Thu, 5 Jan 2006, Darrin Thompson wrote:
>
> Worked great!
Ok. You can bug Junio about it when he returns, maybe he thinks it's a
great feature.
> > +static int show_ignored_directories = 0;
>
> Did you perhaps mean s/ignored/other/g ? I thought maybe you were being
> clever but I couldn't get it to do anything useful with -i, only -o.
Yeah.
Linus
^ permalink raw reply
* Re: git-ls-files -o no recurse?
From: Darrin Thompson @ 2006-01-05 17:15 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0601041330550.3668@g5.osdl.org>
On Wed, 2006-01-04 at 13:31 -0800, Linus Torvalds wrote:
>
> On Wed, 4 Jan 2006, Darrin Thompson wrote:
> >
> > Would it be hard to make git-ls-files optionally do this?
>
> Something like the appended may or may not be what you're looking for..
>
Worked great!
> @@ -19,6 +19,7 @@ static int show_stage = 0;
> static int show_unmerged = 0;
> static int show_modified = 0;
> static int show_killed = 0;
> +static int show_ignored_directories = 0;
> static int line_terminator = '\n';
Did you perhaps mean s/ignored/other/g ? I thought maybe you were being
clever but I couldn't get it to do anything useful with -i, only -o.
--
Darrin
^ permalink raw reply
* Re: use GIT_DIR instead of /var/tmp
From: H. Peter Anvin @ 2006-01-05 17:07 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, git
In-Reply-To: <81b0412b0601050847h1dcd5e81sd5eef3f03df6d1de@mail.gmail.com>
Alex Riesen wrote:
> On 1/5/06, H. Peter Anvin <hpa@zytor.com> wrote:
>
>>>Not every system (will not one microsoft windows system) have /var/tmp,
>>>whereas using GIT_DIR for random temporary files is more or less established.
>>
>>Depends on what you're doing. Only if you're writing to the repository.
>>
>>Windows will usually have $TMP and/or $TEMP, a lot of Unix apps honour
>>$TMP_DIR.
>
>
> Well, it never had TMP/TEMP by default for me (though I'd expect from people
> installing git to set the thing properly), and it is usually undefined
> everywhere else.
Well, for me it's set to
TEMP=C:\Documents and Settings\user\Local Settings\Temp
(except it's all in 8.3-mangled form)... and I sure as Hades didn't set
it. This in on XP SP2. "Local Settings" is a hidden directory which
seems to have stuff like the Internet Exploder cache in it.
-hpa
^ permalink raw reply
* Re: use GIT_DIR instead of /var/tmp
From: Jon Nelson @ 2006-01-05 16:49 UTC (permalink / raw)
Cc: git
In-Reply-To: <Pine.LNX.4.64.0601050840010.3169@g5.osdl.org>
On Thu, 5 Jan 2006, Linus Torvalds wrote:
>
>
> On Thu, 5 Jan 2006, Alex Riesen wrote:
> >
> > Not every system (will not one microsoft windows system) have /var/tmp,
> > whereas using GIT_DIR for random temporary files is more or less established.
>
> Note that in this case it might be appropriate, but in general you should
> be careful. You may want to access a git directory without actually having
> write permissions to it.
>
> Of course, for "git reset" that's not an issue (since it needs write
> permissions anyway), but just in general.. git programs mostly use pipes
> to communicate, and temporary files are pretty rare, so we hopefully don't
> have that issue much, but let's make sure that things that just look at a
> repository can work even with a read-only repo.
Do you still need write access to $GIT_DIR if $GIT_INDEX_FILE is set to
some place outside of $GIT_DIR?
--
Jon Nelson <jnelson-git@jamponi.net>
^ permalink raw reply
* Re: use GIT_DIR instead of /var/tmp
From: Alex Riesen @ 2006-01-05 16:47 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Junio C Hamano, git
In-Reply-To: <43BD4B73.7010000@zytor.com>
On 1/5/06, H. Peter Anvin <hpa@zytor.com> wrote:
> > Not every system (will not one microsoft windows system) have /var/tmp,
> > whereas using GIT_DIR for random temporary files is more or less established.
>
> Depends on what you're doing. Only if you're writing to the repository.
>
> Windows will usually have $TMP and/or $TEMP, a lot of Unix apps honour
> $TMP_DIR.
Well, it never had TMP/TEMP by default for me (though I'd expect from people
installing git to set the thing properly), and it is usually undefined
everywhere else.
^ permalink raw reply
* Re: use result of open(2) to check for presence
From: Morten Welinder @ 2006-01-05 16:45 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, git
In-Reply-To: <81b0412b0601050712q4c2123f7i8e9190c3b75b6fda@mail.gmail.com>
Config files always tend to grow, but I do agree that 4GB config files stretches
credibility a bit.
However, empty ones are not unlikely and then mmap will fail.
M.
^ permalink raw reply
* Re: use GIT_DIR instead of /var/tmp
From: Linus Torvalds @ 2006-01-05 16:42 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, git
In-Reply-To: <81b0412b0601050352n386505bfjd40e515809e3c862@mail.gmail.com>
On Thu, 5 Jan 2006, Alex Riesen wrote:
>
> Not every system (will not one microsoft windows system) have /var/tmp,
> whereas using GIT_DIR for random temporary files is more or less established.
Note that in this case it might be appropriate, but in general you should
be careful. You may want to access a git directory without actually having
write permissions to it.
Of course, for "git reset" that's not an issue (since it needs write
permissions anyway), but just in general.. git programs mostly use pipes
to communicate, and temporary files are pretty rare, so we hopefully don't
have that issue much, but let's make sure that things that just look at a
repository can work even with a read-only repo.
Linus
^ permalink raw reply
* Re: trivial: .gitignore precompiled pyhton modules
From: Alex Riesen @ 2006-01-05 16:38 UTC (permalink / raw)
To: Jon Nelson; +Cc: git, Junio C Hamano
In-Reply-To: <Pine.LNX.4.63.0601050944200.667@gheavc.wnzcbav.cig>
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
On 1/5/06, Jon Nelson <jnelson-git@jamponi.net> wrote:
>
> Don't forget about .pyo
> You also spelled python as 'pyhton'
Hmm, I don't get any of these...
And sorry for the typo, didn't mean no offence :)
For the record, the patch extended and attached.
[-- Attachment #2: 0001-ignore-precompiled-python-modules.txt --]
[-- Type: text/plain, Size: 403 bytes --]
Subject: [PATCH] ignore precompiled python modules
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
.gitignore | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
b250da848d67fade74b13922a46dbc28de7d2892
diff --git a/.gitignore b/.gitignore
index 47d76f4..1a9090b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,3 +120,4 @@ git-core.spec
*.exe
libgit.a
*.o
+*.py[co]
--
1.0.6-gd4ab
^ permalink raw reply related
* Re: use GIT_DIR instead of /var/tmp
From: H. Peter Anvin @ 2006-01-05 16:38 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, git
In-Reply-To: <81b0412b0601050352n386505bfjd40e515809e3c862@mail.gmail.com>
Alex Riesen wrote:
> Not every system (will not one microsoft windows system) have /var/tmp,
> whereas using GIT_DIR for random temporary files is more or less established.
Depends on what you're doing. Only if you're writing to the repository.
Windows will usually have $TMP and/or $TEMP, a lot of Unix apps honour
$TMP_DIR.
-hpa
^ permalink raw reply
* Re: trivial: .gitignore precompiled pyhton modules
From: Jon Nelson @ 2006-01-05 15:44 UTC (permalink / raw)
Cc: git
In-Reply-To: <81b0412b0601050358q6163ef1bqa8696d5881feb657@mail.gmail.com>
Don't forget about .pyo
You also spelled python as 'pyhton'
On Thu, 5 Jan 2006, Alex Riesen wrote:
> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
>
--
Jon Nelson <jnelson-git@jamponi.net>
^ permalink raw reply
* Re: use result of open(2) to check for presence
From: Alex Riesen @ 2006-01-05 15:12 UTC (permalink / raw)
To: Morten Welinder; +Cc: Junio C Hamano, git
In-Reply-To: <118833cc0601050648t17f68bcch8fd7c541585e965c@mail.gmail.com>
On 1/5/06, Morten Welinder <mwelinder@gmail.com> wrote:
> Neat, but perhaps you should check the fstat return code.
> It actually can fail, for example if the filesize cannot be represented in the
> structure because it is too big.
Yes, of course. It will be added along with the missing test for mmap
returning MAP_FAILED. Sometime.
Sarcasm aside, how do you get such a situation?
^ permalink raw reply
* Re: use result of open(2) to check for presence
From: Morten Welinder @ 2006-01-05 14:48 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, git
In-Reply-To: <81b0412b0601050343w4c00ac86y30569c3babbf6728@mail.gmail.com>
Neat, but perhaps you should check the fstat return code.
It actually can fail, for example if the filesize cannot be represented in the
structure because it is too big.
Morten
^ permalink raw reply
* trivial: check, if t/trash directory was successfully created
From: Alex Riesen @ 2006-01-05 11:57 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
and was successfully entered. Otherwise git-init-db will create it directly
in the working directory (t/) which can be dangerous.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0010-Check-if-trash-directory-was-successfully-created.txt --]
[-- Type: text/plain, Size: 816 bytes --]
Subject: [PATCH] Check, if trash directory was successfully created
and was entered. Otherwise git-init-db will create it directly in the
working directory which can be dangerous with all these nasty rm's
in the tests
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/test-lib.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
01d3f8fc7499a2dd5e21513187de7d73af080533
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a97d259..7534a76 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -195,7 +195,7 @@ test -d ../templates/blt || {
test=trash
rm -fr "$test"
mkdir "$test"
-cd "$test"
+cd "$test" || error "Cannot setup test environment"
"$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null ||
error "cannot run git init-db -- have you built things yet?"
--
1.0.GIT
^ permalink raw reply related
* trivial: .gitignore precompiled pyhton modules
From: Alex Riesen @ 2006-01-05 11:58 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0011-ignore-precompiled-pyhton-modules.txt --]
[-- Type: text/plain, Size: 396 bytes --]
Subject: [PATCH] ignore precompiled pyhton modules
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
.gitignore | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
fef595fb79331a83960a5dcee7bf5b3acd58b2b4
diff --git a/.gitignore b/.gitignore
index 47d76f4..778c593 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,3 +120,4 @@ git-core.spec
*.exe
libgit.a
*.o
+*.pyc
--
1.0.GIT
^ permalink raw reply related
* trivial: use git-repo-config to detect how to run tests in the test repository
From: Alex Riesen @ 2006-01-05 11:55 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0009-use-git-repo-config-to-detect-how-to-run-the-test-in-the-test-repository.txt --]
[-- Type: text/plain, Size: 1873 bytes --]
Subject: [PATCH] use git-repo-config
to detect how to run the test in the test repository
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/t4006-diff-mode.sh | 20 +++++++++++++++-----
t/t4102-apply-rename.sh | 9 +++++++--
2 files changed, 22 insertions(+), 7 deletions(-)
306a058f3f3d2a8a420ec4de786398ec77b0fc83
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index e2a67e9..8ad69d1 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -15,11 +15,21 @@ test_expect_success \
tree=`git-write-tree` &&
echo $tree'
-test_expect_success \
- 'chmod' \
- 'chmod +x rezrov &&
- git-update-index rezrov &&
- git-diff-index $tree >current'
+if [ "$(git repo-config --get core.filemode)" = false ]
+then
+ say 'filemode disabled on the filesystem, using update-index --chmod=+x'
+ test_expect_success \
+ 'git-update-index --chmod=+x' \
+ 'git-update-index rezrov &&
+ git-update-index --chmod=+x rezrov &&
+ git-diff-index $tree >current'
+else
+ test_expect_success \
+ 'chmod' \
+ 'chmod +x rezrov &&
+ git-update-index rezrov &&
+ git-diff-index $tree >current'
+fi
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh
index 0401d7b..fbb508d 100755
--- a/t/t4102-apply-rename.sh
+++ b/t/t4102-apply-rename.sh
@@ -31,7 +31,12 @@ test_expect_success setup \
test_expect_success apply \
'git-apply --index --stat --summary --apply test-patch'
-test_expect_success validate \
- 'test -f bar && ls -l bar | grep "^-..x......"'
+if [ "$(git repo-config --get core.filemode)" = false ]
+then
+ say 'filemode disabled on the filesystem'
+else
+ test_expect_success validate \
+ 'test -f bar && ls -l bar | grep "^-..x......"'
+fi
test_done
--
1.0.GIT
^ permalink raw reply related
* trivial: use git-repo-config to detect if the test can be run on the repository
From: Alex Riesen @ 2006-01-05 11:55 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0008-use-git-repo-config-to-detect-if-the-test-can-be-run-on-the-repository.txt --]
[-- Type: text/plain, Size: 801 bytes --]
Subject: [PATCH] use git-repo-config
to detect if the test can be run on the repository
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/t4000-diff-format.sh | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
a03836585a1bc3101c219a31f436d046f37782f2
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index beb6d8f..67b9681 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -26,6 +26,14 @@ rm -f path1
test_expect_success \
'git-diff-files -p after editing work tree.' \
'git-diff-files -p >current'
+
+# that's as far as it comes
+if [ "$(git repo-config --get core.filemode)" = false ]
+then
+ say 'filemode disabled on the filesystem'
+ test_done
+fi
+
cat >expected <<\EOF
diff --git a/path0 b/path0
old mode 100644
--
1.0.GIT
^ permalink raw reply related
* Use testlib to skip t3300-funny-names
From: Alex Riesen @ 2006-01-05 11:53 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 153 bytes --]
The test cannot be run on cygwin anyway.
Corrected the error message to reflect the problem source.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0007-Use-testlib-to-skip-the-test-it-cannot-be-run-on-cygwin.txt --]
[-- Type: text/plain, Size: 1077 bytes --]
Subject: [PATCH] Use testlib to skip the test (it cannot be run on cygwin)
Correct the error message to reflect the problem source
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/t3300-funny-names.sh | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
721ca495bbbff1d387aa48ae401b7a14fb486ac0
diff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh
index 6a85d67..5d70594 100755
--- a/t/t3300-funny-names.sh
+++ b/t/t3300-funny-names.sh
@@ -9,11 +9,15 @@ This test tries pathnames with funny cha
tree, index, and tree objects.
'
-# since FAT/NTFS does not allow tabs in filenames, skip this test
-test "$(uname -o 2>/dev/null)" = Cygwin && exit 0
-
. ./test-lib.sh
+# Since FAT/NTFS does not allow tabs in filenames, skip this test.
+# Windows also have unexplainable problems with names containing only spaces.
+if [ "$(uname -o 2>/dev/null)" = Cygwin ]; then
+ say 'FAT and NTFS on Windows do not allow tabs in filenames, test skipped'
+ test_done
+fi
+
p0='no-funny'
p1='tabs ," (dq) and spaces'
p2='just space'
--
1.0.GIT
^ permalink raw reply related
* use GIT_DIR instead of /var/tmp
From: Alex Riesen @ 2006-01-05 11:52 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 203 bytes --]
Not every system (will not one microsoft windows system) have /var/tmp,
whereas using GIT_DIR for random temporary files is more or less established.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0006-use-GIT_DIR-instead-of-var-tmp.txt --]
[-- Type: text/plain, Size: 531 bytes --]
Subject: [PATCH] use GIT_DIR instead of /var/tmp
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
git-reset.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
9ba3fa786e3de644a9395f99e69cede912f64571
diff --git a/git-reset.sh b/git-reset.sh
index eb44ee8..6c9e58a 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -3,7 +3,7 @@
USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
. git-sh-setup
-tmp=/var/tmp/reset.$$
+tmp=${GIT_DIR}/reset.$$
trap 'rm -f $tmp-*' 0 1 2 3 15
reset_type=--mixed
--
1.0.GIT
^ permalink raw reply related
* [PATCH] git-mv.perl: use stderr for error output and cleanup
From: Alex Riesen @ 2006-01-05 11:49 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
It is cleaned up in the "Perl' meaning" of process: trivial loops
replaced with map{}
[-- Attachment #2: 0005-use-stderr-for-error-output-and-cleanup.txt --]
[-- Type: text/plain, Size: 3458 bytes --]
Subject: [PATCH] use stderr for error output and cleanup
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
git-mv.perl | 38 ++++++++++++++------------------------
1 files changed, 14 insertions(+), 24 deletions(-)
487484f85df999ad949123800e1ab4a24458370b
diff --git a/git-mv.perl b/git-mv.perl
index 83dc7e4..5e7addf 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -37,7 +37,7 @@ if (-d $ARGV[$argCount-1]) {
# remove any trailing slash
$dstDir =~ s/\/$//;
@srcArgs = @ARGV[0..$argCount-2];
-
+
foreach $src (@srcArgs) {
$base = $src;
$base =~ s/^.*\///;
@@ -47,10 +47,9 @@ if (-d $ARGV[$argCount-1]) {
}
else {
if ($argCount != 2) {
- print "Error: moving to directory '"
+ die "Error: moving to directory '"
. $ARGV[$argCount-1]
- . "' not possible; not exisiting\n";
- exit(1);
+ . "' not possible; not existing\n";
}
@srcArgs = ($ARGV[0]);
@dstArgs = ($ARGV[1]);
@@ -63,7 +62,7 @@ my (%overwritten, %srcForDst);
$/ = "\0";
open(F, 'git-ls-files -z |')
- or die "Failed to open pipe from git-ls-files: " . $!;
+ or die "Failed to open pipe from git-ls-files: $!\n";
@allfiles = map { chomp; $_; } <F>;
close(F);
@@ -92,7 +91,7 @@ while(scalar @srcArgs > 0) {
if ($opt_f) {
# only files can overwrite each other: check both source and destination
if (-f $dst && (scalar @srcfiles == 1)) {
- print "Warning: $bad; will overwrite!\n";
+ warn "Warning: $bad; will overwrite!\n";
$bad = "";
$overwritten{$dst} = 1;
}
@@ -101,7 +100,7 @@ while(scalar @srcArgs > 0) {
}
}
}
-
+
if (($bad eq "") && ($dst =~ /^$safesrc\//)) {
$bad = "can not move directory '$src' into itself";
}
@@ -124,11 +123,10 @@ while(scalar @srcArgs > 0) {
if ($bad ne "") {
if ($opt_k) {
- print "Warning: $bad; skipping\n";
+ warn "Warning: $bad; skipping\n";
next;
}
- print "Error: $bad\n";
- exit(1);
+ die "Error: $bad\n";
}
push @srcs, $src;
push @dsts, $dst;
@@ -146,7 +144,7 @@ while(scalar @srcs > 0) {
if (!rename($src,$dst)) {
$bad = "renaming '$src' failed: $!";
if ($opt_k) {
- print "Warning: skipped: $bad\n";
+ warn "Warning: skipped: $bad\n";
$bad = "";
next;
}
@@ -162,6 +160,7 @@ while(scalar @srcs > 0) {
push @deletedfiles, @srcfiles;
if (scalar @srcfiles == 1) {
# $dst can be a directory with 1 file inside
+
if ($overwritten{$dst} ==1) {
push @changedfiles, $dstfiles[0];
@@ -189,30 +188,21 @@ else {
if (@changedfiles) {
open(H, "| git-update-index -z --stdin")
or die "git-update-index failed to update changed files with code $!\n";
- foreach my $fileName (@changedfiles) {
- print H "$fileName\0";
- }
+ print H map {"$_\0"} @changedfiles;
close(H);
}
if (@addedfiles) {
open(H, "| git-update-index --add -z --stdin")
or die "git-update-index failed to add new names with code $!\n";
- foreach my $fileName (@addedfiles) {
- print H "$fileName\0";
- }
+ print H map {"$_\0"} @addedfiles;
close(H);
}
if (@deletedfiles) {
open(H, "| git-update-index --remove -z --stdin")
or die "git-update-index failed to remove old names with code $!\n";
- foreach my $fileName (@deletedfiles) {
- print H "$fileName\0";
- }
+ print H map {"$_\0"} @deletedfiles;
close(H);
}
}
-if ($bad ne "") {
- print "Error: $bad\n";
- exit(1);
-}
+die "Error: $bad\n" if $bad ne "";
--
1.0.GIT
^ permalink raw reply related
* trivial: remove the dots at the end of file names
From: Alex Riesen @ 2006-01-05 11:46 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 106 bytes --]
to make the output more friendly to mouse copy-paste.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0004-Remove-the-dots-at-the-end-of-file-names-to-make-the-output-more-mouse-copy-paste-friendly.txt --]
[-- Type: text/plain, Size: 868 bytes --]
Subject: [PATCH] Remove the dots at the end of file names
to make the output more mouse copy-paste friendly.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
git-merge-one-file.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
fa0739c321265582ba8a914acedcb66f98980a86
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 7dee88a..5349a1c 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -82,7 +82,7 @@ case "${1:-.}${2:-.}${3:-.}" in
expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig
;;
*)
- echo "Auto-merging $4."
+ echo "Auto-merging $4"
orig=`git-unpack-file $1`
;;
esac
@@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in
fi
if [ $ret -ne 0 ]; then
- echo "ERROR: Merge conflict in $4."
+ echo "ERROR: Merge conflict in $4"
exit 1
fi
exec git-update-index -- "$4"
--
1.0.GIT
^ permalink raw reply related
* trivial: clarify, what are the config's user.name and user.email about
From: Alex Riesen @ 2006-01-05 11:44 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0002-clarify-what-are-the-config-s-user.name-and-user.email-about.txt --]
[-- Type: text/plain, Size: 762 bytes --]
Subject: [PATCH] clarify, what are the config's user.name and user.email about
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Documentation/git-commit-tree.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
0da8ab0e8ebacc86e38c029a8577411fbb1379f8
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index a794192..41d1a1c 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -60,7 +60,8 @@ either `.git/config` file, or using the
(nb "<", ">" and "\n"s are stripped)
-In `.git/config` file, the following items are used:
+In `.git/config` file, the following items are used for GIT_AUTHOR_NAME and
+GIT_AUTHOR_EMAIL:
[user]
name = "Your Name"
--
1.0.GIT
^ permalink raw reply related
* trivial: typo
From: Alex Riesen @ 2006-01-05 11:44 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0003-typo.txt --]
[-- Type: text/plain, Size: 624 bytes --]
Subject: [PATCH] typo
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
git-commit.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
870dff0c4ef444c084415d55e40e17aab16a3e68
diff --git a/git-commit.sh b/git-commit.sh
index 7e39c10..82d743b 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -148,7 +148,7 @@ esac
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
echo "#"
- echo "# It looks like your may be committing a MERGE."
+ echo "# It looks like you may be committing a MERGE."
echo "# If this is not correct, please remove the file"
echo "# $GIT_DIR/MERGE_HEAD"
echo "# and try again"
--
1.0.GIT
^ permalink raw reply related
* use result of open(2) to check for presence
From: Alex Riesen @ 2006-01-05 11:43 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 211 bytes --]
Not that the stat against open race would matter much in this context,
but that simplifies
the code a bit. Also some diagnostics added (why the open failed)
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0001-use-result-of-open-2-to-check-for-presence-of-the-old-config-file.txt --]
[-- Type: text/plain, Size: 1713 bytes --]
Subject: [PATCH] use result of open(2) to check for presence
of the old config file
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
config.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
b74ea5a71504808112bd4781a69b17f6009104db
diff --git a/config.c b/config.c
index 992e988..8355224 100644
--- a/config.c
+++ b/config.c
@@ -409,8 +409,7 @@ int git_config_set_multivar(const char*
const char* value_regex, int multi_replace)
{
int i;
- struct stat st;
- int fd;
+ int fd, in_fd;
char* config_filename = strdup(git_path("config"));
char* lock_file = strdup(git_path("config.lock"));
const char* last_dot = strrchr(key, '.');
@@ -457,9 +456,17 @@ int git_config_set_multivar(const char*
/*
* If .git/config does not exist yet, write a minimal version.
*/
- if (stat(config_filename, &st)) {
+ in_fd = open(config_filename, O_RDONLY);
+ if ( in_fd < 0 ) {
free(store.key);
+ if ( ENOENT != errno ) {
+ error("opening %s: %s", config_filename,
+ strerror(errno));
+ close(fd);
+ unlink(lock_file);
+ return 3; /* same as "invalid config file" */
+ }
/* if nothing to unset, error out */
if (value == NULL) {
close(fd);
@@ -471,7 +478,7 @@ int git_config_set_multivar(const char*
store_write_section(fd, key);
store_write_pair(fd, key, value);
} else{
- int in_fd;
+ struct stat st;
char* contents;
int i, copy_begin, copy_end, new_line = 0;
@@ -528,7 +535,7 @@ int git_config_set_multivar(const char*
return 5;
}
- in_fd = open(config_filename, O_RDONLY, 0666);
+ fstat(in_fd, &st);
contents = mmap(NULL, st.st_size, PROT_READ,
MAP_PRIVATE, in_fd, 0);
close(in_fd);
--
1.0.GIT
^ permalink raw reply related
* fix potential deadlock in create_one_file
From: Alex Riesen @ 2006-01-05 9:00 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 137 bytes --]
It can happen if the temporary file already exists (i.e. after a panic
and reboot).
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0002-fix-potential-deadlock-in-create_one_file.txt --]
[-- Type: text/plain, Size: 572 bytes --]
Subject: [PATCH] fix potential deadlock in create_one_file.
It can happen if the temporary file already exists.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
apply.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
f7ac9127638a013d0f1d60e02a06fde10909824c
diff --git a/apply.c b/apply.c
index d5e7bfd..ff3782b 100644
--- a/apply.c
+++ b/apply.c
@@ -1635,7 +1635,8 @@ static void create_one_file(const char *
}
if (errno != EEXIST)
break;
- }
+ ++nr;
+ }
}
die("unable to write file %s mode %o", path, mode);
}
--
1.0.GIT
^ permalink raw reply related
* trivial: O_EXCL makes O_TRUNC redundant
From: Alex Riesen @ 2006-01-05 8:58 UTC (permalink / raw)
To: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
[-- Attachment #2: 0001-O_EXCL-makes-O_TRUNC-redundant.txt --]
[-- Type: text/plain, Size: 1127 bytes --]
Subject: [PATCH] O_EXCL makes O_TRUNC redundant
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
apply.c | 2 +-
entry.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
4d5e4d8d468c0eedf489104e9f02f86c635c8ac2
diff --git a/apply.c b/apply.c
index d5e7bfd..9eba034 100644
--- a/apply.c
+++ b/apply.c
@@ -1588,7 +1588,7 @@ static int try_create_file(const char *p
if (S_ISLNK(mode))
return symlink(buf, path);
- fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_TRUNC, (mode & 0100) ? 0777 : 0666);
+ fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666);
if (fd < 0)
return -1;
while (size) {
diff --git a/entry.c b/entry.c
index 15b34eb..410b758 100644
--- a/entry.c
+++ b/entry.c
@@ -60,7 +60,7 @@ static void remove_subtree(const char *p
static int create_file(const char *path, unsigned int mode)
{
mode = (mode & 0100) ? 0777 : 0666;
- return open(path, O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, mode);
+ return open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
}
static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state)
--
1.0.GIT
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox