* Git public repository naming convention (was: Re: users.txt patch)
From: Benoit SIGOURE @ 2007-10-24 8:41 UTC (permalink / raw)
To: Jim Meyering; +Cc: bug-gnulib, git list
In-Reply-To: <87y7dtt0gk.fsf@rho.meyering.net>
[-- Attachment #1: Type: text/plain, Size: 3029 bytes --]
[CC: Git-ML]
On Oct 24, 2007, at 9:51 AM, Jim Meyering wrote:
> Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
>>> On Oct 24, 2007, at 12:28 AM, Paul Eggert wrote:
>>>> Index: gnulib.html
>>>> ===================================================================
>>>> RCS file: /web/gnulib/gnulib/gnulib.html,v
>>>> retrieving revision 1.13
>>>> retrieving revision 1.16
>>>> diff -p -u -r1.13 -r1.16
>>>> --- gnulib.html 22 Oct 2007 21:41:43 -0000 1.13
>>>> +++ gnulib.html 23 Oct 2007 22:22:18 -0000 1.16
>>>> @@ -57,14 +57,20 @@ You can also view the <a href="MODULES.h
>>>> anonymous <a href='http://git.or.cz/'>Git</a>, using the following
>>>> shell command:</p>
>>>>
>>>> -<pre><samp>git clone git://git.savannah.gnu.org/gnulib.git
>>>> +<pre><samp>git clone git://git.savannah.gnu.org/gnulib
>>>> </samp></pre>
>>
>> Is there any reason why this has changed? I learned (the hard way)
>> that for bare public repositories, it's better to stick to what turns
>> out to be more than a naming convention of `project.git'. I don't
>
> What are the consequences of not doing that?
You can't git-clone the remote repo because it tries to fetch the
wrong URL (if the url isn't of the form `foo.git' it will try to
fetch `foo/.git' which will fail).
>> know if these issues are only related to dumb protocols (HTTP*) or if
>> they also affect the Git protocol. I can't find the relevant thread
>
> Hmm... maybe it's http-specific?
> Things seem to work fine with the git protocol.
Yeah, that's what I wondered.
>> on the Git ML but the thing is that it seems that several tools rely
>> on the fact that a repository name of the form `foo.git' implies that
>> it's a bare repository (and thus it doesn't need to look for a
>> nested
>> .git directory).
>
> It has always worked -- on that server, at least.
> I use that form because I prefer the shorter URL:
>
> git clone git://git.sv.gnu.org/gnulib
>
> In general, if you control the server repo,
> you can simply add a symlink in project.git:
>
> .git -> ..
>
> I suppose that avoids any such problems, but I haven't
> done that on any of the savannah repositories.
Yeah well that's more of a workaround than anything else.
My guess: it works with the Git protocol, probably because git-http-
fetch works differently than whatever tool does the fetch for the
native Git protocol. OTOH, isn't it better to have a consistent
naming? If you look at the gitweb of gnulib [ http://
git.savannah.gnu.org/gitweb/?p=gnulib.git ], it says "URL git://
git.sv.gnu.org/gnulib.git". Oddly enough, whether you add the `.git'
or not doesn't seem to change anything.
The documentation (Documentation/urls.txt) only shows examples of the
form `git://host.xz/path/to/repo.git/'. So do Documentation/core-
tutorial.txt, Documentation/git-clone.txt and Documentation/
repository-layout.txt (among others).
Maybe the Git gurus will be able to shed some light on this issue.
Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]
^ permalink raw reply
* Re: intended use of "git --exec-path"?
From: Andreas Ericsson @ 2007-10-24 8:08 UTC (permalink / raw)
To: Scott Parish; +Cc: git
In-Reply-To: <20071024043224.GR16291@srparish.net>
Scott Parish wrote:
> "git --exec-path" presently prints out the highest priority path
> to find executable in. That's a what; i'm curious why and when it
> should be used. Basically i'm wondering if its still useful, and
> what, if anything, it should be printing.
>
git supports having all its "helpers" in a separate path. Since
there were performance concerns with having scripts call the git
wrapper for every invocation of every git program, the --exec-path
option was added when the wrapper was rewritten in C.
Unless it's a very tight loop that runs non-builtin programs,
there's really no reason for scripts to use the git-whatever form
of commands, but the ability to do so should probably be retained
more or less forever. See 8e49d50388211a0f3e7286f6ee600bf7736f4814
for details.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: [PATCH 9/9] git-svn: Make fetch ~1.7x faster
From: Adam Roben @ 2007-10-24 6:48 UTC (permalink / raw)
To: Eric Wong; +Cc: git, Junio C Hamano
In-Reply-To: <20071024063401.GB10916@soma>
Eric Wong wrote:
> Adam Roben <aroben@apple.com> wrote:
>
>> +package Git::Commands;
>>
>
> Can this be a separate file, or a part of Git.pm? I'm sure other
> scripts can eventually use this and I've been meaning to split
> git-svn.perl into separate files so it's easier to follow.
>
I had considered doing one of the above, but decided that splitting it
out could be done if/when it was deemed useful for another script. But
I'll split it out since you think it's a good idea.
>> +use vars qw/$_cat_blob_pid $_cat_blob_in $_cat_blob_out $_cat_blob_ctx $_cat_blob_separator
>> + $_hash_object_pid $_hash_object_in $_hash_object_out $_hash_object_ctx/;
>>
>
> I have trouble following long lines, and most of the git code also wraps
> at 80-columns. Dead-tree publishers got this concept right a long
> time ago :)
>
Will fix.
>> +use strict;
>> +use warnings;
>> +use File::Temp qw/tempfile/;
>> +use Git qw/command_bidi_pipe command_close_bidi_pipe/;
>> +
>> +sub _open_cat_blob_if_needed {
>> + return if defined($_cat_blob_pid);
>> + $_cat_blob_separator = "--------------GITCATFILESEPARATOR-----------";
>>
>
> Brian brought this up already, but yes, having pre-defined separators
> instead of explicitly-specified sizes makes it all too easy for a
> malicious user to commit code that will break things for git-svn users.
>
Yup, will fix this. :-)
>> +sub hash_object {
>> + my (undef, $fh) = @_;
>> +
>> + my ($tmp_fh, $tmp_filename) = tempfile(UNLINK => 1);
>> + while (my $line = <$fh>) {
>> + print $tmp_fh $line;
>> + }
>> + close($tmp_fh);
>>
>
> Related to the above. It's better to sysread()/syswrite() or
> read()/print() in a loop with a predefined buffer size rather than to
> use a readline() since you could be dealing with files with very long
> lines or binaries with no newline characters in them at all.
>
Hm, OK. I'll look for similar code in git-svn and follow that.
>> + _open_hash_object_if_needed();
>> + print $_hash_object_out $tmp_filename . "\n";
>>
>
> Minor, but
>
> print $_hash_object_out $tmp_filename, "\n";
>
> avoids creating a new string.
>
Good idea.
Thanks for the feedback! I'll send out some new patches sometime soon.
-Adam
^ permalink raw reply
* Re: [PATCH 9/9] git-svn: Make fetch ~1.7x faster
From: Eric Wong @ 2007-10-24 6:34 UTC (permalink / raw)
To: Adam Roben; +Cc: git, Junio C Hamano
In-Reply-To: <1193118397-4696-10-git-send-email-aroben@apple.com>
Adam Roben <aroben@apple.com> wrote:
> We were spending a lot of time forking/execing git-cat-file and
> git-hash-object. We now use command_bidi_pipe to keep one instance of each
> running and feed it input on stdin.
Nice job! I just got access to a very fast SVN repository for a project
I'm working on (not working on git-svn itself, unfortunately).
A few comments and small nitpicks below:
> Signed-off-by: Adam Roben <aroben@apple.com>
> ---
> git-svn.perl | 94 ++++++++++++++++++++++++++++++++++++++++++++-------------
> 1 files changed, 72 insertions(+), 22 deletions(-)
> +package Git::Commands;
Can this be a separate file, or a part of Git.pm? I'm sure other
scripts can eventually use this and I've been meaning to split
git-svn.perl into separate files so it's easier to follow.
> +use vars qw/$_cat_blob_pid $_cat_blob_in $_cat_blob_out $_cat_blob_ctx $_cat_blob_separator
> + $_hash_object_pid $_hash_object_in $_hash_object_out $_hash_object_ctx/;
I have trouble following long lines, and most of the git code also wraps
at 80-columns. Dead-tree publishers got this concept right a long
time ago :)
> +use strict;
> +use warnings;
> +use File::Temp qw/tempfile/;
> +use Git qw/command_bidi_pipe command_close_bidi_pipe/;
> +
> +sub _open_cat_blob_if_needed {
> + return if defined($_cat_blob_pid);
> + $_cat_blob_separator = "--------------GITCATFILESEPARATOR-----------";
Brian brought this up already, but yes, having pre-defined separators
instead of explicitly-specified sizes makes it all too easy for a
malicious user to commit code that will break things for git-svn users.
> +sub hash_object {
> + my (undef, $fh) = @_;
> +
> + my ($tmp_fh, $tmp_filename) = tempfile(UNLINK => 1);
> + while (my $line = <$fh>) {
> + print $tmp_fh $line;
> + }
> + close($tmp_fh);
Related to the above. It's better to sysread()/syswrite() or
read()/print() in a loop with a predefined buffer size rather than to
use a readline() since you could be dealing with files with very long
lines or binaries with no newline characters in them at all.
> + _open_hash_object_if_needed();
> + print $_hash_object_out $tmp_filename . "\n";
Minor, but
print $_hash_object_out $tmp_filename, "\n";
avoids creating a new string.
--
Eric Wong
^ permalink raw reply
* Re: [PATCH 7/9] git-hash-object: Add --stdin-paths option
From: Eric Wong @ 2007-10-24 6:11 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Adam Roben, git, Junio C Hamano
In-Reply-To: <20071023061022.GG14735@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> wrote:
> Adam Roben <aroben@apple.com> wrote:
> > Shawn O. Pearce wrote:
> > >Adam Roben <aroben@apple.com> wrote:
> > >
> > >>This allows multiple paths to be specified on stdin.
> > >
> > >git-fast-import wasn't suited to the task?
> >
> > I actually considered using fast-import for the whole shebang, but
> > decided that I don't yet understand the workings and structure of
> > git-svn well enough to make such a big change.
> >
> > git-svn uses git-hash-object to both determine a file's hash and insert
> > it into the index in one go -- can fast-import do this? Or will it just
> > put it in the index and not give you the hash back? The latter was my
> > impression.
>
> It doesn't currently give you the hash back. You can sort of get
> to it by marking the blob then using the 'checkpoint' command to
> dump the marks to a file, which you can read in. Not good.
>
> It probably wouldn't be very difficult to give fast-import a way
> to dump marks back on stdout as they are assigned. So long as the
> frontend either locksteps with fast-import or is willing to monitor
> it with a select/poll type of arrangement and read from stdout as
> soon as its ready.
>
> Probably a 5 line code change to fast-import. Like this. Only Git
> won't recognize that object SHA-1 as its in a packfile that has
> no index. You'd need to 'checkpoint' to flush the object out, or
> just use all of fast-import for the processing. So yea, I guess
> I can see now how its not suited to this.
Shawn, thanks for clearing that up. I was previously considering
fast-import for git-svn, but never had time[1] to really look at it.
I guess Adam is on the right track with his patches.
[1] - Sorry to all on the list, but I've really been slacking on git-svn
work. I was going to get some stuff done this weekend but decided
to attempt to fight my nasty caffeine addiction instead :x
--
Eric Wong
^ permalink raw reply
* Re: intended use of "git --exec-path"?
From: David Symonds @ 2007-10-24 5:54 UTC (permalink / raw)
To: Scott Parish; +Cc: Shawn O. Pearce, git
In-Reply-To: <20071024054749.GT16291@srparish.net>
On 10/24/07, Scott Parish <sRp@srparish.net> wrote:
> On Wed, Oct 24, 2007 at 12:38:19AM -0400, Shawn O. Pearce wrote:
>
> > Scott Parish <sRp@srparish.net> wrote:
> > > "git --exec-path" presently prints out the highest priority path
> > > to find executable in. That's a what; i'm curious why and when it
> > > should be used. Basically i'm wondering if its still useful, and
> > > what, if anything, it should be printing.
> >
> > git-gui uses it. git-gui runs git-* by prefixing it with the
> > exec path. It also scans the first line of the file if we are on
> > Windows and the "executable" doesn't end in ".exe" so it can figure
> > out what process to run it through.
> >
> > So it really can't go away.
>
> So it sounds like it might be more helpful for git to return its
> PATH, so other programs can set their PATH or search for executables
> accordingly.
You don't necessarily want to be monkeying around with $PATH if you're
trying to use a particular git installation (say, a build of next)
instead of your "proper" install, which is in your $PATH; if you call
/some/random/path/git-whatever, it should use the git tools in
/some/random/path/, not in $PATH.
Dave.
^ permalink raw reply
* Re: intended use of "git --exec-path"?
From: Scott Parish @ 2007-10-24 5:47 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20071024043819.GI14735@spearce.org>
On Wed, Oct 24, 2007 at 12:38:19AM -0400, Shawn O. Pearce wrote:
> Scott Parish <sRp@srparish.net> wrote:
> > "git --exec-path" presently prints out the highest priority path
> > to find executable in. That's a what; i'm curious why and when it
> > should be used. Basically i'm wondering if its still useful, and
> > what, if anything, it should be printing.
>
> git-gui uses it. git-gui runs git-* by prefixing it with the
> exec path. It also scans the first line of the file if we are on
> Windows and the "executable" doesn't end in ".exe" so it can figure
> out what process to run it through.
>
> So it really can't go away.
So it sounds like it might be more helpful for git to return its
PATH, so other programs can set their PATH or search for executables
accordingly.
sRp
--
Scott Parish
http://srparish.net/
^ permalink raw reply
* Re: What's cooking in git/spearce.git (topics)
From: Theodore Tso @ 2007-10-24 0:12 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Shawn O. Pearce, Johannes Schindelin, git
In-Reply-To: <7vtzoh7j1l.fsf@gitster.siamese.dyndns.org>
On Tue, Oct 23, 2007 at 12:00:38PM -0700, Junio C Hamano wrote:
>
> You can view 'next' as if it is sort of -mm. Following 'master'
> is like following Linus tree, whose development is without those
> numerous 'merge improvements again' merges into 'next'.
Actually -mm is much closer to 'pu', since it can and is rewound all
the time. Patches can disappear if they are causing problems, they
can be replaced and reworked, etc.
- Ted
^ permalink raw reply
* [PATCH 3/3] Bisect: refactor "bisect_{bad,good,skip}" into "bisect_state".
From: Christian Couder @ 2007-10-24 5:01 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
git-bisect.sh | 82 +++++++++++++++++++++-----------------------------------
1 files changed, 31 insertions(+), 51 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 61a2956..f8d0099 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -135,47 +135,33 @@ bisect_write() {
test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
}
-bisect_bad() {
+bisect_state() {
bisect_autostart
- case "$#" in
- 0)
- rev=$(git rev-parse --verify HEAD) ;;
- 1)
- rev=$(git rev-parse --verify "$1^{commit}") ;;
+ state=$1
+ case "$#,$state" in
+ 0,*)
+ die "Please call 'bisect_state' with at least one argument." ;;
+ 1,bad|1,good|1,skip)
+ rev=$(git rev-parse --verify HEAD) ||
+ die "Bad rev input: HEAD"
+ bisect_write "$state" "$rev" ;;
+ 2,bad)
+ rev=$(git rev-parse --verify "$2^{commit}") ||
+ die "Bad rev input: $2"
+ bisect_write "$state" "$rev" ;;
+ *,good|*,skip)
+ shift
+ revs=$(git rev-parse --revs-only --no-flags "$@") &&
+ test '' != "$revs" || die "Bad rev input: $@"
+ for rev in $revs
+ do
+ rev=$(git rev-parse --verify "$rev^{commit}") ||
+ die "Bad rev commit: $rev^{commit}"
+ bisect_write "$state" "$rev"
+ done ;;
*)
usage ;;
- esac || exit
- bisect_write 'bad' "$rev"
- bisect_auto_next
-}
-
-bisect_good() {
- bisect_autostart
- case "$#" in
- 0) revs=$(git rev-parse --verify HEAD) || exit ;;
- *) revs=$(git rev-parse --revs-only --no-flags "$@") &&
- test '' != "$revs" || die "Bad rev input: $@" ;;
esac
- for rev in $revs
- do
- rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write 'good' "$rev"
- done
- bisect_auto_next
-}
-
-bisect_skip() {
- bisect_autostart
- case "$#" in
- 0) revs=$(git rev-parse --verify HEAD) || exit ;;
- *) revs=$(git rev-parse --revs-only --no-flags "$@") &&
- test '' != "$revs" || die "Bad rev input: $@" ;;
- esac
- for rev in $revs
- do
- rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write 'skip' "$rev"
- done
bisect_auto_next
}
@@ -405,24 +391,22 @@ bisect_run () {
exit $res
fi
- # Use "bisect_good" or "bisect_bad"
- # depending on run success or failure.
+ # Find current state depending on run success or failure.
if [ $res -gt 0 ]; then
- next_bisect='bisect_bad'
+ state='bad'
else
- next_bisect='bisect_good'
+ state='good'
fi
- # We have to use a subshell because bisect_good or
- # bisect_bad functions can exit.
- ( $next_bisect > "$GIT_DIR/BISECT_RUN" )
+ # We have to use a subshell because "bisect_state" can exit.
+ ( bisect_state $state > "$GIT_DIR/BISECT_RUN" )
res=$?
cat "$GIT_DIR/BISECT_RUN"
if [ $res -ne 0 ]; then
echo >&2 "bisect run failed:"
- echo >&2 "$next_bisect exited with error code $res"
+ echo >&2 "'bisect_state $state' exited with error code $res"
exit $res
fi
@@ -444,12 +428,8 @@ case "$#" in
case "$cmd" in
start)
bisect_start "$@" ;;
- bad)
- bisect_bad "$@" ;;
- good)
- bisect_good "$@" ;;
- skip)
- bisect_skip "$@" ;;
+ bad|good|skip)
+ bisect_state "$cmd" "$@" ;;
next)
# Not sure we want "next" at the UI level anymore.
bisect_next "$@" ;;
--
1.5.3.4.215.g187cf
^ permalink raw reply related
* [PATCH 2/3] Bisect: refactor some logging into "bisect_write".
From: Christian Couder @ 2007-10-24 5:01 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Also use "die" instead of "echo >&2 something ; exit 1".
And simplify "bisect_replay".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
git-bisect.sh | 47 ++++++++++++++---------------------------------
1 files changed, 14 insertions(+), 33 deletions(-)
The 'nolog="$3"' line is back in this patch.
diff --git a/git-bisect.sh b/git-bisect.sh
index 82aa404..61a2956 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -106,12 +106,11 @@ bisect_start() {
die "'$arg' does not appear to be a valid revision"
break
}
- if [ $bad_seen -eq 0 ]; then
- bad_seen=1
- bisect_write 'bad' "$rev"
- else
- bisect_write 'good' "$rev"
- fi
+ case $bad_seen in
+ 0) state='bad' ; bad_seen=1 ;;
+ *) state='good' ;;
+ esac
+ bisect_write "$state" "$rev" 'nolog'
shift
;;
esac
@@ -125,6 +124,7 @@ bisect_start() {
bisect_write() {
state="$1"
rev="$2"
+ nolog="$3"
case "$state" in
bad) tag="$state" ;;
good|skip) tag="$state"-"$rev" ;;
@@ -132,6 +132,7 @@ bisect_write() {
esac
echo "$rev" >"$GIT_DIR/refs/bisect/$tag"
echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+ test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
}
bisect_bad() {
@@ -145,7 +146,6 @@ bisect_bad() {
usage ;;
esac || exit
bisect_write 'bad' "$rev"
- echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
bisect_auto_next
}
@@ -160,7 +160,6 @@ bisect_good() {
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write 'good' "$rev"
- echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
@@ -176,7 +175,6 @@ bisect_skip() {
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write 'skip' "$rev"
- echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
@@ -352,10 +350,8 @@ bisect_reset() {
else
branch=master
fi ;;
- 1) git show-ref --verify --quiet -- "refs/heads/$1" || {
- echo >&2 "$1 does not seem to be a valid branch"
- exit 1
- }
+ 1) git show-ref --verify --quiet -- "refs/heads/$1" ||
+ die "$1 does not seem to be a valid branch"
branch="$1" ;;
*)
usage ;;
@@ -375,10 +371,7 @@ bisect_clean_state() {
}
bisect_replay () {
- test -r "$1" || {
- echo >&2 "cannot read $1 for replaying"
- exit 1
- }
+ test -r "$1" || die "cannot read $1 for replaying"
bisect_reset
while read bisect command rev
do
@@ -386,23 +379,11 @@ bisect_replay () {
case "$command" in
start)
cmd="bisect_start $rev"
- eval "$cmd"
- ;;
- good)
- bisect_write 'good' "$rev"
- echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
- ;;
- bad)
- bisect_write 'bad' "$rev"
- echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
- ;;
- skip)
- bisect_write 'skip' "$rev"
- echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
- ;;
+ eval "$cmd" ;;
+ good|bad|skip)
+ bisect_write "$command" "$rev" ;;
*)
- echo >&2 "?? what are you talking about?"
- exit 1 ;;
+ die "?? what are you talking about?" ;;
esac
done <"$1"
bisect_auto_next
--
1.5.3.4.215.g187cf
^ permalink raw reply related
* [PATCH 1/3] Bisect: refactor "bisect_write_*" functions.
From: Christian Couder @ 2007-10-24 5:01 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
git-bisect.sh | 46 ++++++++++++++++++++--------------------------
1 files changed, 20 insertions(+), 26 deletions(-)
This patch series change the title of 3 patches in the
"bisect skip" series from "Bisect: factorise ..." to
"Bisect: refactor ...".
In the second patch in this series a missing line has
also been added back.
diff --git a/git-bisect.sh b/git-bisect.sh
index cd46190..82aa404 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -108,9 +108,9 @@ bisect_start() {
}
if [ $bad_seen -eq 0 ]; then
bad_seen=1
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
else
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
fi
shift
;;
@@ -122,6 +122,18 @@ bisect_start() {
bisect_auto_next
}
+bisect_write() {
+ state="$1"
+ rev="$2"
+ case "$state" in
+ bad) tag="$state" ;;
+ good|skip) tag="$state"-"$rev" ;;
+ *) die "Bad bisect_write argument: $state" ;;
+ esac
+ echo "$rev" >"$GIT_DIR/refs/bisect/$tag"
+ echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+}
+
bisect_bad() {
bisect_autostart
case "$#" in
@@ -132,17 +144,11 @@ bisect_bad() {
*)
usage ;;
esac || exit
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
bisect_auto_next
}
-bisect_write_bad() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/bad"
- echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_good() {
bisect_autostart
case "$#" in
@@ -153,18 +159,12 @@ bisect_good() {
for rev in $revs
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
-bisect_write_good() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
- echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_skip() {
bisect_autostart
case "$#" in
@@ -175,18 +175,12 @@ bisect_skip() {
for rev in $revs
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write_skip "$rev"
+ bisect_write 'skip' "$rev"
echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
-bisect_write_skip() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/skip-$rev"
- echo "# skip: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_next_check() {
missing_good= missing_bad=
git show-ref -q --verify refs/bisect/bad || missing_bad=t
@@ -395,15 +389,15 @@ bisect_replay () {
eval "$cmd"
;;
good)
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
;;
bad)
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
;;
skip)
- bisect_write_skip "$rev"
+ bisect_write 'skip' "$rev"
echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
;;
*)
--
1.5.3.4.215.g187cf
^ permalink raw reply related
* Re: intended use of "git --exec-path"?
From: Shawn O. Pearce @ 2007-10-24 4:38 UTC (permalink / raw)
To: Scott Parish; +Cc: git
In-Reply-To: <20071024043224.GR16291@srparish.net>
Scott Parish <sRp@srparish.net> wrote:
> "git --exec-path" presently prints out the highest priority path
> to find executable in. That's a what; i'm curious why and when it
> should be used. Basically i'm wondering if its still useful, and
> what, if anything, it should be printing.
git-gui uses it. git-gui runs git-* by prefixing it with the
exec path. It also scans the first line of the file if we are on
Windows and the "executable" doesn't end in ".exe" so it can figure
out what process to run it through.
So it really can't go away.
--
Shawn.
^ permalink raw reply
* intended use of "git --exec-path"?
From: Scott Parish @ 2007-10-24 4:32 UTC (permalink / raw)
To: git
"git --exec-path" presently prints out the highest priority path
to find executable in. That's a what; i'm curious why and when it
should be used. Basically i'm wondering if its still useful, and
what, if anything, it should be printing.
Thanks
sRp
--
Scott Parish
http://srparish.net/
^ permalink raw reply
* Re: [PATCH 5/9] git-cat-file: Add --separator option
From: Adam Roben @ 2007-10-24 4:26 UTC (permalink / raw)
To: Brian Downing; +Cc: git, Junio C Hamano
In-Reply-To: <20071024034301.GE24924@lavos.net>
Brian Downing wrote:
> On Mon, Oct 22, 2007 at 10:46:33PM -0700, Adam Roben wrote:
>
>> +--separator::
>> + A string to print in between the output for each object passed on
>> + stdin. A newline will be appended to the separator each time it is
>> + printed.
>>
>
> Maybe I'm just unreasonably paranoid, but I don't think I could ever
> trust that you'd never find an arbitrary separator in the data. I
> suppose if you scanned the files beforehand you could come up with
> something guaranteed to be unique, but that seems like a pain (and
> doesn't happen regardless in patch 9/9; it just uses
> "--------------GITCATFILESEPARATOR-----------") If I were committing to
> SVN, it's sure not something I'd like to bet the integrity of my data
> on.
>
I had some of the same concerns.
> I think a far more reasonable output format for multiple objects would
> be something like:
>
> <count> LF
> <raw data> LF
>
> Where <count> is the number of bytes in the <raw data> as an ASCII
> decimal integer.
>
This sounds like a much better solution. I'll implement it that way and
send out a new patch. Thanks for the suggestion!
-Adam
^ permalink raw reply
* Re: [PATCH 4/7] Bisect: factorise "bisect_write_*" functions.
From: Christian Couder @ 2007-10-24 4:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
In-Reply-To: <7v640x7a4n.fsf@gitster.siamese.dyndns.org>
Le mercredi 24 octobre 2007, Junio C Hamano a écrit :
> Sort of offtopic, but is "factorise" a correct verb here? I
> thought "factorise" is to express a non prime number as the
> product of prime numbers.
English is not my mother tongue so I very often make mistakes.
Sorry about that.
Anyway my prefered online dictionary finds it:
http://www.wordreference.com/definition/factorise
> "refactor" is the act of splitting and merging pieces of
> functions for better reuse, isn't it?
Yes, it would be better.
I used "factorise" because as a french native speaker, I am always tempted
to use word that sound the same as their french translation.
By the way I realised that the "bisect_write" function is still
missing 'nolog="$3"', so I will send an updated patch.
Thanks,
Christian.
^ permalink raw reply
* Re: [PATCH 5/9] git-cat-file: Add --separator option
From: Brian Downing @ 2007-10-24 3:43 UTC (permalink / raw)
To: Adam Roben; +Cc: git, Junio C Hamano
In-Reply-To: <1193118397-4696-6-git-send-email-aroben@apple.com>
On Mon, Oct 22, 2007 at 10:46:33PM -0700, Adam Roben wrote:
> +--separator::
> + A string to print in between the output for each object passed on
> + stdin. A newline will be appended to the separator each time it is
> + printed.
Maybe I'm just unreasonably paranoid, but I don't think I could ever
trust that you'd never find an arbitrary separator in the data. I
suppose if you scanned the files beforehand you could come up with
something guaranteed to be unique, but that seems like a pain (and
doesn't happen regardless in patch 9/9; it just uses
"--------------GITCATFILESEPARATOR-----------") If I were committing to
SVN, it's sure not something I'd like to bet the integrity of my data
on.
I think a far more reasonable output format for multiple objects would
be something like:
<count> LF
<raw data> LF
Where <count> is the number of bytes in the <raw data> as an ASCII
decimal integer.
This is pretty much the spiritual analog to the fast-import "exact byte
count" data input format as well.
-bcd
^ permalink raw reply
* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
From: Jakub Narebski @ 2007-10-24 2:06 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Andreas Ericsson, Steffen Prohaska, Federico Mena Quintero, git
In-Reply-To: <Pine.LNX.4.64.0710221156540.25221@racer.site>
On 10/22/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> So once again, what operations involving git do people use regularly?
>
> <rationale>There is a good chance that git is not optimised for most
> people's daily workflows, as project maintainers seemed to be much more
> forthcoming with patches, and therefore maintainers' tasks are much more
> optimised than in other SCMs.</rationale>
For working on gitweb in git.git repository.
1. Fetch (when I am on topic branch) or pull (in rare cases I am on master)
2. "stg rebase origin"
3. work, work, work, using StGIT to generate perfect patch series
(going back and forth between patches, reordering patches, adding
patch in the middle of series, concatenating two patches, etc.; for
example when I notice that something should be changed in previous
patch, be it either bug noticed just now, or change in preparatory
patch to better suit main one)
4. fetch and rebase just between publishing
5. git format-patch to generate patch series; use git-shortlog or
grepping for patches subjects and git-diff --stat to generate
introductory email. Unfortunately StGIT template for introductory
email does have neither shortlog nor diffstat fields to atomatically
fill. Add comments to patches if needed.
6. Either use KMail + attach inline (no word wrap), or git-send-mail
(with sendmail configured to use gmail account; now I could use simply
git-send-mail configuration in user config) to send patches to git
mailing list
7. Push changes (if I don't forget) to repo.or.cz repository (jnareb-git.git).
--
Jakub Narebski
^ permalink raw reply
* git-{diff,ls}-files from a subdirectory fails ...
From: Karl Hasselström @ 2007-10-24 1:20 UTC (permalink / raw)
To: git
... when GIT_DIR is specified.
I have a repository at ~/stgit-lib. With cwd at the top of the tree,
things work as expected when I set all those fancy envoronment
variables:
kha@yoghurt:~/stgit-lib> git-diff-files --name-only
stgit/utillib.py
kha@yoghurt:~/stgit-lib> GIT_DIR=/home/kha/stgit-lib/.git GIT_INDEX_FILE=/home/kha/stgit-lib/.git/index GIT_WORK_TREE=/home/kha/stgit-lib git-diff-files --name-only
stgit/utillib.py
However, it doen't seem to work from a subdirectory:
kha@yoghurt:~/stgit-lib/stgit> git-diff-files --name-only
stgit/utillib.py
kha@yoghurt:~/stgit-lib/stgit> GIT_DIR=/home/kha/stgit-lib/.git GIT_INDEX_FILE=/home/kha/stgit-lib/.git/index GIT_WORK_TREE=/home/kha/stgit-lib git-diff-files --name-only | wc
170 170 3560
Instead of just the one changed file, I get a list of what looks like
all the files in the project, suggesting that maybe git assumes I'm at
the root of the worktree when I'm not.
git-ls-files seems to behave the same way. Bug or user error?
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: UI and git-completion.sh
From: Brian Downing @ 2007-10-24 0:57 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: Steven Grimm, Matthieu Moy, Paolo Ciarrocchi, git
In-Reply-To: <20071024005549.GC24924@lavos.net>
On Tue, Oct 23, 2007 at 07:55:49PM -0500, Brian Downing wrote:
> I dunno the "right" way to do it, but I had this in my .zshrc file that
> I presumably cargo-culted from somewhere:
>
> fpath=( $HOME/.zsh/compfuncs $fpath )
I think this has to come before "compinit" or whatever starts up the new
completion engine.
-bcd
^ permalink raw reply
* Re: UI and git-completion.sh
From: Brian Downing @ 2007-10-24 0:55 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: Steven Grimm, Matthieu Moy, Paolo Ciarrocchi, git
In-Reply-To: <86d4v59wvt.fsf@blue.stonehenge.com>
On Tue, Oct 23, 2007 at 05:31:02PM -0700, Randal L. Schwartz wrote:
> Yes, so what is the process of adding the git zsh completion to any
> relatively stable version of zsh? Someone here must know.
I dunno the "right" way to do it, but I had this in my .zshrc file that
I presumably cargo-culted from somewhere:
fpath=( $HOME/.zsh/compfuncs $fpath )
So in addition to that, doing:
wget -O ~/.zsh/compfuncs/_git 'http://zsh.cvs.sourceforge.net/*checkout*/zsh/zsh/Completion/Unix/Command/_git'
might get you something. I guess if your zsh is too old it might be
incompatible with the completion script, though...
-bcd
^ permalink raw reply
* Re: UI and git-completion.sh
From: Randal L. Schwartz @ 2007-10-24 0:50 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Steven Grimm, Paolo Ciarrocchi, git
In-Reply-To: <vpqbqapgx0j.fsf@bauges.imag.fr>
>>>>> "Matthieu" == Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Matthieu> http://zsh.cvs.sourceforge.net/zsh/zsh/Completion/Unix/Command/_git
Matthieu> Try adding it to your $fpath, hopefully, the new _git doesn't use the
Matthieu> other new zsh features, and it will work (I have a CVS _git with a
Matthieu> 4.3.4 zsh, and it works like a charm).
Do I add it as _git below my $fpath? Or do I need to put it into a subdir?
How will it know it is there?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply
* Re: UI and git-completion.sh
From: Matthieu Moy @ 2007-10-24 0:46 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: Steven Grimm, Paolo Ciarrocchi, git
In-Reply-To: <86prz59y9s.fsf@blue.stonehenge.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
>>>>>> "Matthieu" == Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
> Matthieu> In zsh itself.
>
> Matthieu> Completion/Unix/Command/_git
>
> Not in my version of zsh. Any chance I can add that to my 4.2.3
> installation?
http://zsh.cvs.sourceforge.net/zsh/zsh/Completion/Unix/Command/_git
Try adding it to your $fpath, hopefully, the new _git doesn't use the
other new zsh features, and it will work (I have a CVS _git with a
4.3.4 zsh, and it works like a charm).
--
Matthieu
^ permalink raw reply
* Re: [PATCH 0/9] Make git-svn fetch ~1.7x faster
From: Sam Vilain @ 2007-10-24 0:43 UTC (permalink / raw)
To: Mike Hommey; +Cc: git, aroben
In-Reply-To: <20071023060812.GA30978@glandium.org>
Mike Hommey wrote:
> On Mon, Oct 22, 2007 at 10:46:28PM -0700, Adam Roben wrote:
>> This patch series makes git-svn fetch about 1.7x faster by reducing the number
>> of forks/execs that occur for each file retrieved from Subversion. To do so, a
>> few new options are added to git-cat-file and git-hash-object to allow
>> continuous input on stdin and continuous output on stdout, so that one instance
>> of each of these commands can be kept running for the duration of the fetch.
>
> You don't need to do this to avoid forks. Just use git-fast-import
> instead.
git-fast-import only covers the hash-object side of things, not cat-file.
git-fast-import does not currently suit 'gradual deployment' for
converters such as git-svn, because it;
- returns object IDs at the end, when you checkpoint.
This could be 'fixed' by allowing a marks log file instead of or in
addition to the current behaviour, though if the exporter is
continually waiting for the tokens rather than using marks, it will
slow it down.
- you can't use plumbing commands, such as rev-parse, cat-file, etc on
objects which have not been checkpointed yet.
- can't just stream a file of unknown length to it as you can to
hash-object
These are the design trade-offs of using fast-import. Using
fast-import, you are creating a 'transaction' area which uses user
sequences instead of (git)database-issued identifiers. And this
transaction is isolated from the other concurrent users of the object
database. However the interface does not have the full git CLI
available to it, so unlike a regular database transaction, you end up
having to care.
Rewriting the importer so as to correctly deal with these problems is
quite challenging, and for slow import sources such as Subversion, of
limited merit.
Sam.
^ permalink raw reply
* Re: UI and git-completion.sh
From: Randal L. Schwartz @ 2007-10-24 0:31 UTC (permalink / raw)
To: Steven Grimm; +Cc: Matthieu Moy, Paolo Ciarrocchi, git
In-Reply-To: <471E91C9.3000004@midwinter.com>
>>>>> "Steven" == Steven Grimm <koreth@midwinter.com> writes:
Steven> And I think we've just proven that more documentation is required
Steven> here! (I have no idea how to enable it myself; I just know I've seen
Steven> it mentioned on the list from time to time.)
Yes, so what is the process of adding the git zsh completion to any relatively
stable version of zsh? Someone here must know.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply
* Re: [PATCH] On error, do not list all commands, but point to --help option.
From: Salikh Zakirov @ 2007-10-24 0:28 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Johannes Schindelin, Jari Aalto, git
In-Reply-To: <20071021020653.GA14735@spearce.org>
Shawn O. Pearce wrote:
> Hmm. Lets see.
>
> "cvs foo":
> Big spew of commands. Like "git foo".
>
> "svn foo":
> Unknown command: 'foo'
> Type 'svn help' for usage.
>
> Both are considered to be more newbie friendly then Git. So clearly
> SVN's output of almost nothing is friendly. And so is CVS'
> big spew of frequently used commands. Either way is apparently
> newbie friendly.
>
> Though I find SVN's message a little insulting, asking me to type.
> I know I have to type the command, thanks.
On the contrary, I consider CVS and current Git output more insulting,
as it assumes I forgot all the commands every time I made a typo.
The polite part of the message is to point out a typo,
as "Unknown command 'foo'" above. The "Type "svn help" for usage" part
is just a reminder for complete newbies, which doesn't take too much space
and can be reasonably ignored by experienced users.
^ permalink raw reply
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