* [PATCH] git-svn: SVN 1.1.x library compatibility
From: Eric Wong @ 2006-06-28 10:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7virml4pqg.fsf@assigned-by-dhcp.cox.net>
Tested on a plain Ubuntu Hoary installation
using subversion 1.1.1-2ubuntu3
1.1.x issues I had to deal with:
* Avoid the noisy command-line client compatibility check if we
use the libraries.
* get_log() arguments differ (now using a nice wrapper from
Junio's suggestion)
* get_file() is picky about what kind of file handles it gets,
so I ended up redirecting STDOUT. I'm probably overflushing
my file handles, but that's the safest thing to do...
* BDB kept segfaulting on me during tests, so svnadmin will use FSFS
whenever we can.
* If somebody used an expanded CVS $Id$ line inside a file, then
propsetting it to use svn:keywords will cause the original CVS
$Id$ to be retained when asked for the original file. As far as
I can see, this is a server-side issue. We won't care in the
test anymore, as long as it's not expanded by SVN, a static
CVS $Id$ line is fine.
While we're at making ourselves more compatible, avoid grep
along with the -q flag, which is GNU-specific. (grep avoidance
tip from Junio, too)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
Junio C Hamano <junkio@cox.net> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> > * get_log() arguments differ.
>
> Maybe you would want to have a single wrapper sub {} for this,
> instead of repeating it all over, perhaps like this:
>
> sub log_get {
> my ($SVN_LOG, @args) = @_;
> if ($SVN::CORE::VERSION ge '1.2.0') {
> splice(@args, 3, 0, 0);
> }
> $SVN_LOG->get_log(@args);
> }
I actually did it backwards (le) in case I want create something that
could take advantage of the limit arg for newer versions but degrade
gracefully for 1.1.x
contrib/git-svn/git-svn.perl | 30 +++++++++++++++++-----
contrib/git-svn/t/lib-git-svn.sh | 8 +++++-
contrib/git-svn/t/t0000-contrib-git-svn.sh | 14 +++++++++-
contrib/git-svn/t/t0001-contrib-git-svn-props.sh | 4 +--
4 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 08c3010..f026b24 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -134,7 +134,7 @@ usage(1) unless defined $cmd;
init_vars();
load_authors() if $_authors;
load_all_refs() if $_branch_all_refs;
-svn_compat_check();
+svn_compat_check() unless $_use_lib;
migration_check() unless $cmd =~ /^(?:init|rebuild|multi-init)$/;
$cmd{$cmd}->[0]->(@ARGV);
exit 0;
@@ -379,7 +379,8 @@ sub fetch_lib {
# performance sucks with it enabled, so it's much
# faster to fetch revision ranges instead of relying
# on the limiter.
- $SVN_LOG->get_log( '/'.$SVN_PATH, $min, $max, 0, 1, 1,
+ libsvn_get_log($SVN_LOG, '/'.$SVN_PATH,
+ $min, $max, 0, 1, 1,
sub {
my $log_msg;
if ($last_commit) {
@@ -924,7 +925,7 @@ sub graft_file_copy_lib {
$SVN::Error::handler = \&libsvn_skip_unknown_revs;
while (1) {
my $pool = SVN::Pool->new;
- $SVN_LOG->get_log( "/$path", $min, $max, 0, 1, 1,
+ libsvn_get_log($SVN_LOG, "/$path", $min, $max, 0, 1, 1,
sub {
libsvn_graft_file_copies($grafts, $tree_paths,
$path, @_);
@@ -2358,8 +2359,8 @@ sub libsvn_load {
return unless $_use_lib;
$_use_lib = eval {
require SVN::Core;
- if ($SVN::Core::VERSION lt '1.2.1') {
- die "Need SVN::Core 1.2.1 or better ",
+ if ($SVN::Core::VERSION lt '1.1.0') {
+ die "Need SVN::Core 1.1.0 or better ",
"(got $SVN::Core::VERSION) ",
"Falling back to command-line svn\n";
}
@@ -2392,9 +2393,15 @@ sub libsvn_get_file {
my $pool = SVN::Pool->new;
defined($pid = open3($in, $out, '>&STDERR',
qw/git-hash-object -w --stdin/)) or croak $!;
- my ($r, $props) = $SVN->get_file($f, $rev, $in, $pool);
+ # redirect STDOUT for SVN 1.1.x compatibility
+ open my $stdout, '>&', \*STDOUT or croak $!;
+ open STDOUT, '>&', $in or croak $!;
+ $| = 1; # not sure if this is necessary, better safe than sorry...
+ my ($r, $props) = $SVN->get_file($f, $rev, \*STDOUT, $pool);
$in->flush == 0 or croak $!;
+ open STDOUT, '>&', $stdout or croak $!;
close $in or croak $!;
+ close $stdout or croak $!;
$pool->clear;
chomp($hash = do { local $/; <$out> });
close $out or croak $!;
@@ -2566,7 +2573,8 @@ sub revisions_eq {
if ($_use_lib) {
# should be OK to use Pool here (r1 - r0) should be small
my $pool = SVN::Pool->new;
- $SVN->get_log("/$path", $r0, $r1, 0, 1, 1, sub {$nr++},$pool);
+ libsvn_get_log($SVN, "/$path", $r0, $r1,
+ 0, 1, 1, sub {$nr++}, $pool);
$pool->clear;
} else {
my ($url, undef) = repo_path_split($SVN_URL);
@@ -2606,6 +2614,14 @@ sub libsvn_find_parent_branch {
return undef;
}
+sub libsvn_get_log {
+ my ($ra, @args) = @_;
+ if ($SVN::Core::VERSION le '1.2.0') {
+ splice(@args, 3, 1);
+ }
+ $ra->get_log(@args);
+}
+
sub libsvn_new_tree {
if (my $log_entry = libsvn_find_parent_branch(@_)) {
return $log_entry;
diff --git a/contrib/git-svn/t/lib-git-svn.sh b/contrib/git-svn/t/lib-git-svn.sh
index 2843258..d7f972a 100644
--- a/contrib/git-svn/t/lib-git-svn.sh
+++ b/contrib/git-svn/t/lib-git-svn.sh
@@ -33,7 +33,13 @@ svnrepo=$PWD/svnrepo
set -e
-svnadmin create $svnrepo
+if svnadmin create --help | grep fs-type >/dev/null
+then
+ svnadmin create --fs-type fsfs "$svnrepo"
+else
+ svnadmin create "$svnrepo"
+fi
+
svnrepo="file://$svnrepo/test-git-svn"
diff --git a/contrib/git-svn/t/t0000-contrib-git-svn.sh b/contrib/git-svn/t/t0000-contrib-git-svn.sh
index 443d518..b482bb6 100644
--- a/contrib/git-svn/t/t0000-contrib-git-svn.sh
+++ b/contrib/git-svn/t/t0000-contrib-git-svn.sh
@@ -5,6 +5,16 @@ #
test_description='git-svn tests'
GIT_SVN_LC_ALL=$LC_ALL
+
+case "$LC_ALL" in
+*.UTF-8)
+ have_utf8=t
+ ;;
+*)
+ have_utf8=
+ ;;
+esac
+
. ./lib-git-svn.sh
mkdir import
@@ -173,7 +183,7 @@ then
fi
-if test -n "$GIT_SVN_LC_ALL" && echo $GIT_SVN_LC_ALL | grep -q '\.UTF-8$'
+if test "$have_utf8" = t
then
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
echo '# hello' >> exec-2.sh
@@ -203,7 +213,7 @@ fi
name='check imported tree checksums expected tree checksums'
rm -f expected
-if test -n "$GIT_SVN_LC_ALL" && echo $GIT_SVN_LC_ALL | grep -q '\.UTF-8$'
+if test "$have_utf8" = t
then
echo tree f735671b89a7eb30cab1d8597de35bd4271ab813 > expected
fi
diff --git a/contrib/git-svn/t/t0001-contrib-git-svn-props.sh b/contrib/git-svn/t/t0001-contrib-git-svn-props.sh
index 54e0ed7..a5a235f 100644
--- a/contrib/git-svn/t/t0001-contrib-git-svn-props.sh
+++ b/contrib/git-svn/t/t0001-contrib-git-svn-props.sh
@@ -21,8 +21,8 @@ a_empty_crlf=
cd import
cat >> kw.c <<\EOF
-/* Make it look like somebody copied a file from CVS into SVN: */
-/* $Id: kw.c,v 1.1.1.1 1994/03/06 00:00:00 eric Exp $ */
+/* Somebody prematurely put a keyword into this file */
+/* $Id$ */
EOF
printf "Hello\r\nWorld\r\n" > crlf
--
1.4.1.rc1.gc7c5
^ permalink raw reply related
* Re: Quick merge status updates.
From: Pavel Roskin @ 2006-06-28 10:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7j3164xd.fsf@assigned-by-dhcp.cox.net>
On Wed, 2006-06-28 at 01:49 -0700, Junio C Hamano wrote:
> I suspect this is either FC perl-dev package is broken (I doubt
> it) or your installation procedure is pecurilar (much more
> likely). I pass the same set of prefix, bindir and friends to
> "make" and "make install" and do not see the problem.
I think my Perl 5.8.8 is "too new". "man perlfunc" says about "use":
"Imports some semantics into the current package from the named module,
generally by aliasing certain subroutine or variable names into your
package. It is exactly equivalent to
BEGIN { require Module; import Module LIST; }
except that Module must be a bareword."
I think the BEGIN block has priority over other statements. My solution
was to put the @INC change in the BEGIN block as well.
This patch is working for me:
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index e8fad02..1b23fa1 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,7 @@ #
# Read .git/FETCH_HEAD and make a human readable merge message
# by grouping branches and tags together to form a single line.
-unshift @INC, '@@INSTLIBDIR@@';
+BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
use strict;
use Git;
use Error qw(:try);
--
Regards,
Pavel Roskin
^ permalink raw reply related
* Re: CFT: merge-recursive in C (updated)
From: Johannes Schindelin @ 2006-06-28 10:04 UTC (permalink / raw)
To: Alex Riesen; +Cc: git, Junio C Hamano, Fredrik Kuivinen, Linus Torvalds
In-Reply-To: <81b0412b0606280234x7d07fbbck7887b5214d98bf91@mail.gmail.com>
Hi,
On Wed, 28 Jun 2006, Alex Riesen wrote:
> On 6/28/06, Alex Riesen <fork0@t-online.de> wrote:
> > Johannes Schindelin, Tue, Jun 27, 2006 18:42:51 +0200:
> > > > - use a pipe to "git-update-index --index-info" instead of using command
> > > > line
>
> ...and to take it a step further, a patch (0002) to avoid too many calls to
> git-write-tree and to git-update-index.
... and introduces a lot more lines doing debug output.
However, the change is good, but I would not call it "FILE *fp". IMHO
"FILE *update_index_pipe" would explain better what you do there.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] quote.c: silence compiler warnings from EMIT macro
From: Junio C Hamano @ 2006-06-28 10:01 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20060628055923.GA6071@coredump.intra.peff.net>
Thanks.
^ permalink raw reply
* Re: [PATCH 1/2] rebase: check for errors from git-commit
From: Junio C Hamano @ 2006-06-28 9:56 UTC (permalink / raw)
To: git
In-Reply-To: <20060628095454.GA23948@soma>
Eric Wong <normalperson@yhbt.net> writes:
> Junio C Hamano <junkio@cox.net> wrote:
>> Eric Wong <normalperson@yhbt.net> writes:
>>
>> > Junio C Hamano <junkio@cox.net> wrote:
>> >
>> >> Anticipating failure from "git-commit" is the right thing to do,
>> >> but this is a "Now what?" situation. What is the expected
>> >> course of action to recover from this for the end user, and how
>> >> can we phrase the error message to help that process?
>> >
>> > I would expect git-commit to show the correct error message (or the
>> > pre-commit hook), die "$RESOLVEMSG" might be a better option, though.
>>
>> It would say 'resolve conflicts, mark them with update-index as
>> necessary, and say git-commit' or somesuch. I am not sure you
>> would want the user to make a commit like suggested -- instead
>> you would want him to say 'git rebase --continue' wouldn't you?
>
> Actually RESOLVEMSG in git-rebase just tells the user about the
> --continue, --skip, --abort options.
Yup, so telling the user to disregard what commit might say (but
do not hide it by redirecting 2>/dev/null, please) and dying
with "$RESOLVEMSG" might be a better way.
^ permalink raw reply
* Re: [PATCH 1/2] rebase: check for errors from git-commit
From: Eric Wong @ 2006-06-28 9:54 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vveql38zr.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
>
> > Junio C Hamano <junkio@cox.net> wrote:
> >
> >> Anticipating failure from "git-commit" is the right thing to do,
> >> but this is a "Now what?" situation. What is the expected
> >> course of action to recover from this for the end user, and how
> >> can we phrase the error message to help that process?
> >
> > I would expect git-commit to show the correct error message (or the
> > pre-commit hook), die "$RESOLVEMSG" might be a better option, though.
>
> It would say 'resolve conflicts, mark them with update-index as
> necessary, and say git-commit' or somesuch. I am not sure you
> would want the user to make a commit like suggested -- instead
> you would want him to say 'git rebase --continue' wouldn't you?
Actually RESOLVEMSG in git-rebase just tells the user about the
--continue, --skip, --abort options.
--
Eric Wong
^ permalink raw reply
* Re: [PATCH] git.c: Re-introduce sane error messages on missing commands.
From: Junio C Hamano @ 2006-06-28 9:53 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Andreas Ericsson, git
In-Reply-To: <Pine.LNX.4.63.0606281118330.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Try this:
>
> $ mkdir 5
> $ cd 5
> $ git-init-db
> $ rm .git/config # yes, really.
> $ git abc
Thanks for trying to help, but not really.
: gitster; mkdir 5
: gitster; cd 5
: gitster; git-init-db
defaulting to local storage area
: gitster; rm .git/config
: gitster; ~/git-master/bin/git abc
git: 'abc' is not a git-command
The most commonly used git commands are:
add Add files to the index file
apply Apply patch on a git index file and a work
...
tag Create a tag object signed with GPG
verify-tag Check the GPG signature of tag
(use 'git help -a' to get a list of all installed git commands)
: gitster; ~/git-master/bin/git --version
git version 1.4.1.rc1.g8096
: gitster; ls -ld ~/.gitrc ~/.gitconfig ~/.git-config
: gitster; ls -ld ~/.gitrc ~/.gitconfig ~/.git-config
ls: /home/junio/.gitrc: No such file or directory
ls: /home/junio/.gitconfig: No such file or directory
ls: /home/junio/.git-config: No such file or directory
: gitster; : confused...
^ permalink raw reply
* Re: [PATCH 1/2] rebase: check for errors from git-commit
From: Junio C Hamano @ 2006-06-28 9:49 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <20060628093322.GA29036@hand.yhbt.net>
Eric Wong <normalperson@yhbt.net> writes:
> Junio C Hamano <junkio@cox.net> wrote:
>
>> Anticipating failure from "git-commit" is the right thing to do,
>> but this is a "Now what?" situation. What is the expected
>> course of action to recover from this for the end user, and how
>> can we phrase the error message to help that process?
>
> I would expect git-commit to show the correct error message (or the
> pre-commit hook), die "$RESOLVEMSG" might be a better option, though.
It would say 'resolve conflicts, mark them with update-index as
necessary, and say git-commit' or somesuch. I am not sure you
would want the user to make a commit like suggested -- instead
you would want him to say 'git rebase --continue' wouldn't you?
^ permalink raw reply
* Re: [PATCH 1/2] rebase: check for errors from git-commit
From: Junio C Hamano @ 2006-06-28 9:25 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <11514858662929-git-send-email-normalperson@yhbt.net>
Eric Wong <normalperson@yhbt.net> writes:
> I've grown used to having 'set -e' at the beginning of my shell
> scripts. IMHO it'd be a good idea to start moving towards this
> eventually (even though shell scripts seem to be getting phased-out
> somewhat).
>
> git-rebase.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/git-rebase.sh b/git-rebase.sh
> index 9ad1c44..47c8e8f 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -59,8 +59,8 @@ continue_merge () {
>
> if test -n "`git-diff-index HEAD`"
> then
> + git-commit -C "`cat $dotest/current`" || die 'Commit failed'
> printf "Committed: %0${prec}d" $msgnum
> - git-commit -C "`cat $dotest/current`"
Anticipating failure from "git-commit" is the right thing to do,
but this is a "Now what?" situation. What is the expected
course of action to recover from this for the end user, and how
can we phrase the error message to help that process?
^ permalink raw reply
* Re: CFT: merge-recursive in C
From: Junio C Hamano @ 2006-06-28 9:22 UTC (permalink / raw)
To: Uwe Zeisberger; +Cc: Alex Riesen, git
In-Reply-To: <20060628063747.GA983@informatik.uni-freiburg.de>
Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> writes:
> Hello Alex,
>
>> +// does not belong here
> Some C compiler (e.g. Sun Forte) don't like C++-style comments.
Heh, I said something like that last year and was scolded by
Linus who responded "what century are you living in?" ;-).
^ permalink raw reply
* Re: [PATCH] git.c: Re-introduce sane error messages on missing commands.
From: Johannes Schindelin @ 2006-06-28 9:21 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Junio C Hamano, git
In-Reply-To: <44A23A38.3090206@op5.se>
Hi,
On Wed, 28 Jun 2006, Andreas Ericsson wrote:
> Junio C Hamano wrote:
> > Andreas Ericsson <ae@op5.se> writes:
> >
> >
> > > Somewhere in the alias handling git turned hostile on fat fingers:
> > >
> > > $ git showbranch
> > > Failed to run command '': Is a directory
> >
> >
> > Does not happen here (nor on Cygwin 1.4.1.rc1). Care to help
> > reproducing it?
Try this:
$ mkdir 5
$ cd 5
$ git-init-db
$ rm .git/config # yes, really.
$ git abc
Ciao,
Dscho
^ permalink raw reply
* [PATCH] Fix a mixed declarations and code warning
From: Timo Hirvonen @ 2006-06-28 9:15 UTC (permalink / raw)
To: junkio; +Cc: git
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---
NOTE: This is for the pu branch
exec_cmd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/exec_cmd.c b/exec_cmd.c
index f2133ec..62f51fc 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -98,8 +98,8 @@ int execv_git_cmd(const char **argv)
argv[0] = git_command;
if (getenv("GIT_TRACE")) {
- fputs("trace: exec:", stderr);
const char **p = argv;
+ fputs("trace: exec:", stderr);
while (*p) {
fputc(' ', stderr);
sq_quote_print(stderr, *p);
--
1.4.1.rc1.g1ef9
^ permalink raw reply related
* Re: Quick merge status updates.
From: Johannes Schindelin @ 2006-06-28 9:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, pasky
In-Reply-To: <7vy7vh4q8w.fsf@assigned-by-dhcp.cox.net>
Hi,
On Wed, 28 Jun 2006, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Hi,
> >
> > on my iBook, make in pu outputs:
> >
> > GIT_VERSION = 1.4.1.rc1.gf5d3
> > * new build flags or prefix
> > (cd perl && /usr/bin/perl Makefile.PL \
> > PREFIX='/Users/gene099' \
> > DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\''
> > -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
> > LIBS=' -L/sw/lib -lz -liconv -lcrypto -lssl')
> > Can't locate Devel/PPPort.pm in @INC (@INC contains:
> > /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin
> > /Library/Perl /Library/Perl /Network/Library/Perl/darwin
> > /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> > BEGIN failed--compilation aborted at Makefile.PL line 29.
> > make: *** [perl/Makefile] Error 2
> >
> > FWIW all Perl scripts in git, except git-send-email, work here.
>
> I suspect git-fmt-merge-msg doesn't, and perhaps git-mv.
Last time I checked, git-mv worked (couple of weeks ago). And if I am not
mistaken, git-fmt-merge-msg is needed when git-pull does not fast forward?
I definitely successfully merged on my iBook, IIRC last time was last
week.
BTW: Devel/PPPort.pm is introduced by this line in perl/Git.xs:
> #include "ppport.h"
Ciao,
Dscho
^ permalink raw reply
* [PATCH 2/2] rebase: get rid of outdated MRESOLVEMSG
From: Eric Wong @ 2006-06-28 9:11 UTC (permalink / raw)
To: Junio C Hamano, git; +Cc: Eric Wong
In-Reply-To: <11514858662929-git-send-email-normalperson@yhbt.net>
There was a time when rebase --skip didn't work when used with
--merge, but that is no more so we don't need that message
anymore.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-rebase.sh | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 47c8e8f..16fe6e0 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -34,11 +34,6 @@ When you have resolved this problem run
If you would prefer to skip this patch, instead run \"git rebase --skip\".
To restore the original branch and stop rebasing run \"git rebase --abort\".
"
-
-MRESOLVEMSG="
-When you have resolved this problem run \"git rebase --continue\".
-To restore the original branch and stop rebasing run \"git rebase --abort\".
-"
unset newbase
strategy=recursive
do_merge=
@@ -54,7 +49,7 @@ continue_merge () {
then
echo "You still have unmerged paths in your index"
echo "did you forget update-index?"
- die "$MRESOLVEMSG"
+ die "$RESOLVEMSG"
fi
if test -n "`git-diff-index HEAD`"
@@ -87,11 +82,11 @@ call_merge () {
;;
1)
test -d "$GIT_DIR/rr-cache" && git-rerere
- die "$MRESOLVEMSG"
+ die "$RESOLVEMSG"
;;
2)
echo "Strategy: $rv $strategy failed, try another" 1>&2
- die "$MRESOLVEMSG"
+ die "$RESOLVEMSG"
;;
*)
die "Unknown exit code ($rv) from command:" \
--
1.4.1.rc1.g3cc8
^ permalink raw reply related
* [PATCH 1/2] rebase: check for errors from git-commit
From: Eric Wong @ 2006-06-28 9:11 UTC (permalink / raw)
To: Junio C Hamano, git; +Cc: Eric Wong
commit does not always succeed, so we'll have to check for
it in the absence of set -e. This fixes a regression
introduced in 9e4bc7dd1bb9d92491c475cec55147fa0b3f954d
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
I've grown used to having 'set -e' at the beginning of my shell
scripts. IMHO it'd be a good idea to start moving towards this
eventually (even though shell scripts seem to be getting phased-out
somewhat).
git-rebase.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 9ad1c44..47c8e8f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -59,8 +59,8 @@ continue_merge () {
if test -n "`git-diff-index HEAD`"
then
+ git-commit -C "`cat $dotest/current`" || die 'Commit failed'
printf "Committed: %0${prec}d" $msgnum
- git-commit -C "`cat $dotest/current`"
else
printf "Already applied: %0${prec}d" $msgnum
fi
--
1.4.1.rc1.g3cc8
^ permalink raw reply related
* [PATCH] Make some strings const
From: Timo Hirvonen @ 2006-06-28 9:04 UTC (permalink / raw)
To: junkio; +Cc: git
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---
builtin-mailinfo.c | 2 +-
builtin-rev-parse.c | 2 +-
commit.c | 2 +-
connect.c | 4 ++--
daemon.c | 4 ++--
describe.c | 2 +-
git.c | 3 ++-
http-push.c | 4 ++--
imap-send.c | 2 +-
sha1_file.c | 2 +-
upload-pack.c | 4 ++--
11 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 821642a..3e40747 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -165,7 +165,7 @@ static int handle_subject(char *line)
static int slurp_attr(const char *line, const char *name, char *attr)
{
- char *ends, *ap = strcasestr(line, name);
+ const char *ends, *ap = strcasestr(line, name);
size_t sz;
if (!ap) {
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index b27a6d3..5f5ade4 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -329,7 +329,7 @@ int cmd_rev_parse(int argc, const char *
dotdot = strstr(arg, "..");
if (dotdot) {
unsigned char end[20];
- char *next = dotdot + 2;
+ const char *next = dotdot + 2;
const char *this = arg;
*dotdot = 0;
if (!*next)
diff --git a/commit.c b/commit.c
index 946615d..0327df1 100644
--- a/commit.c
+++ b/commit.c
@@ -543,7 +543,7 @@ static int add_merge_info(enum cmit_fmt
const char *hex = abbrev
? find_unique_abbrev(p->object.sha1, abbrev)
: sha1_to_hex(p->object.sha1);
- char *dots = (abbrev && strlen(hex) != 40) ? "..." : "";
+ const char *dots = (abbrev && strlen(hex) != 40) ? "..." : "";
parent = parent->next;
offset += sprintf(buf + offset, " %s%s", hex, dots);
diff --git a/connect.c b/connect.c
index 66e78a2..f9d9202 100644
--- a/connect.c
+++ b/connect.c
@@ -330,7 +330,7 @@ static int git_tcp_connect_sock(char *ho
{
int sockfd = -1;
char *colon, *end;
- char *port = STR(DEFAULT_GIT_PORT);
+ const char *port = STR(DEFAULT_GIT_PORT);
struct addrinfo hints, *ai0, *ai;
int gai;
@@ -525,7 +525,7 @@ static int git_use_proxy(const char *hos
static void git_proxy_connect(int fd[2],
const char *prog, char *host, char *path)
{
- char *port = STR(DEFAULT_GIT_PORT);
+ const char *port = STR(DEFAULT_GIT_PORT);
char *colon, *end;
int pipefd[2][2];
pid_t pid;
diff --git a/daemon.c b/daemon.c
index 1ba4d66..e096bd7 100644
--- a/daemon.c
+++ b/daemon.c
@@ -35,7 +35,7 @@ static char *base_path = NULL;
* after ~user/. E.g. a request to git://host/~alice/frotz would
* go to /home/alice/pub_git/frotz with --user-path=pub_git.
*/
-static char *user_path = NULL;
+static const char *user_path = NULL;
/* Timeout, and initial timeout */
static unsigned int timeout = 0;
@@ -472,7 +472,7 @@ static void child_handler(int signo)
children_reaped = reaped + 1;
/* XXX: Custom logging, since we don't wanna getpid() */
if (verbose) {
- char *dead = "";
+ const char *dead = "";
if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)
dead = " (with error)";
if (log_syslog)
diff --git a/describe.c b/describe.c
index aa3434a..8e68d5d 100644
--- a/describe.c
+++ b/describe.c
@@ -97,7 +97,7 @@ static int compare_names(const void *_a,
return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
}
-static void describe(char *arg, int last_one)
+static void describe(const char *arg, int last_one)
{
unsigned char sha1[20];
struct commit *cmit;
diff --git a/git.c b/git.c
index 8b060e8..90b86a6 100644
--- a/git.c
+++ b/git.c
@@ -17,7 +17,8 @@ #include "builtin.h"
static void prepend_to_path(const char *dir, int len)
{
- char *path, *old_path = getenv("PATH");
+ const char *old_path = getenv("PATH");
+ char *path;
int path_len = len;
if (!old_path)
diff --git a/http-push.c b/http-push.c
index 3c89a17..e281f70 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1274,7 +1274,7 @@ xml_cdata(void *userData, const XML_Char
strlcpy(ctx->cdata, s, len + 1);
}
-static struct remote_lock *lock_remote(char *path, long timeout)
+static struct remote_lock *lock_remote(const char *path, long timeout)
{
struct active_request_slot *slot;
struct slot_results results;
@@ -2130,7 +2130,7 @@ static int remote_exists(const char *pat
return -1;
}
-static void fetch_symref(char *path, char **symref, unsigned char *sha1)
+static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
{
char *url;
struct buffer buffer;
diff --git a/imap-send.c b/imap-send.c
index 94e39cd..65c71c6 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -242,7 +242,7 @@ socket_read( Socket_t *sock, char *buf,
}
static int
-socket_write( Socket_t *sock, char *buf, int len )
+socket_write( Socket_t *sock, const char *buf, int len )
{
int n = write( sock->fd, buf, len );
if (n != len) {
diff --git a/sha1_file.c b/sha1_file.c
index c80528b..8179630 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -343,7 +343,7 @@ static void read_info_alternates(const c
void prepare_alt_odb(void)
{
- char *alt;
+ const char *alt;
alt = getenv(ALTERNATE_DB_ENVIRONMENT);
if (!alt) alt = "";
diff --git a/upload-pack.c b/upload-pack.c
index 7b86f69..2b70c3d 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -95,8 +95,8 @@ static void create_pack_file(void)
int i;
int args;
const char **argv;
+ const char **p;
char *buf;
- char **p;
if (create_full_pack) {
args = 10;
@@ -441,7 +441,7 @@ static int receive_needs(void)
static int send_ref(const char *refname, const unsigned char *sha1)
{
- static char *capabilities = "multi_ack thin-pack side-band";
+ static const char *capabilities = "multi_ack thin-pack side-band";
struct object *o = parse_object(sha1);
if (!o)
--
1.4.1.rc1.g1ef9
^ permalink raw reply related
* Re: [PATCH 1/5] git-svn: SVN 1.1.x library compatibility
From: Junio C Hamano @ 2006-06-28 9:02 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <11514623563534-git-send-email-normalperson@yhbt.net>
Eric Wong <normalperson@yhbt.net> writes:
> Tested on a plain Ubuntu Hoary installation
> using subversion 1.1.1-2ubuntu3
>
> 1.1.x issues I had to deal with:
>
> * Avoid the noisy command-line client compatibility check if we
> use the libraries.
>
> * get_log() arguments differ.
Maybe you would want to have a single wrapper sub {} for this,
instead of repeating it all over, perhaps like this:
sub log_get {
my ($SVN_LOG, @args) = @_;
if ($SVN::CORE::VERSION ge '1.2.0') {
splice(@args, 3, 0, 0);
}
$SVN_LOG->get_log(@args);
}
> -if test -n "$GIT_SVN_LC_ALL" && echo $GIT_SVN_LC_ALL | grep -q '\.UTF-8$'
> +if test -n "$GIT_SVN_LC_ALL" && echo $GIT_SVN_LC_ALL |grep '\.UTF-8$' >/dev/null
> then
Hmph. I tend to do something like this instead of pipeing echo
to grep:
case "$LC_ALL" in
*.UTF-8)
# it is utf-8
;;
*)
# otherwise
;;
esac
^ permalink raw reply
* Re: Quick merge status updates.
From: Junio C Hamano @ 2006-06-28 8:51 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, pasky
In-Reply-To: <Pine.LNX.4.63.0606280938420.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Hi,
>
> on my iBook, make in pu outputs:
>
> GIT_VERSION = 1.4.1.rc1.gf5d3
> * new build flags or prefix
> (cd perl && /usr/bin/perl Makefile.PL \
> PREFIX='/Users/gene099' \
> DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\''
> -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
> LIBS=' -L/sw/lib -lz -liconv -lcrypto -lssl')
> Can't locate Devel/PPPort.pm in @INC (@INC contains:
> /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin
> /Library/Perl /Library/Perl /Network/Library/Perl/darwin
> /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> BEGIN failed--compilation aborted at Makefile.PL line 29.
> make: *** [perl/Makefile] Error 2
>
> FWIW all Perl scripts in git, except git-send-email, work here.
I suspect git-fmt-merge-msg doesn't, and perhaps git-mv.
^ permalink raw reply
* Re: Quick merge status updates.
From: Junio C Hamano @ 2006-06-28 8:49 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1151471040.4940.17.camel@dv>
Pavel Roskin <proski@gnu.org> writes:
> PowerPC 32-bit, G3, Fedora Core 5, gcc 4.1.1, perl 5.8.8, pu branch
> (f5d33e0b4eaa4083b455118a7be473defb61f137)
Thanks.
> Warnings:
>
> quote.c: In function 'sq_quote_buf':
> quote.c:34: warning: value computed is not used
> quote.c:37: warning: value computed is not used
Thanks. I think these are dealt with Jeff King's patches.
> combine-diff.c: In function 'diff_tree_combined':
> combine-diff.c:844: warning: assignment makes integer from pointer
> without a cast
Thanks. The fix is actually simple (two paragraphs below).
> In file included
> from /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/perl.h:756,
> from Git.xs:15:
> /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/embed.h:4195:1:
> warning: "die" redefined
> Git.xs:11:1: warning: this is the location of the previous definition
I've seen this but haven't looked into it. Pasky?
> I'm very concerned about the combine-diff.c warning. The warning seems
> to be legitimate and I don't see an obvious fix. The offending line
> comes from 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 ("Fix some more diff
> options changes"):
>
> show_log_first = rev->loginfo;
This is saying "If rev->loginfo is pointing at some string, we
are going to show the log message first and then output from the
diff machinery (otherwise rev->loginfo has NULL)". I'll
rephrase it to read as:
show_log_first = !!rev->loginfo;
> The testsuite passes, but "git-pull" is indeed broken:
>
> $ git-pull
> Can't locate Git.pm in @INC (@INC
> contains: /usr/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/ve
ndor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/proski/bin/git-fmt-merge-msg line 10.
> BEGIN failed--compilation aborted at /home/proski/bin/git-fmt-merge-msg
> line 10.
>
> Git.pm is installed into
> /home/proski/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi/
The same problem with the last paragraph.
> Speaking of x86_64 (also Fedora Core 5, gcc 4.1.1, perl 5.8.8), git
> doesn't even build:
$ git grep -A1 -e 'Define USE_PIC" pu:Makefile
in other words:
USE_PIC=YesPlease make
> The testsuite passes. git-pull is also broken with a similar error
> message. Git.pm is installed into
> /home/proski/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/
I suspect this is either FC perl-dev package is broken (I doubt
it) or your installation procedure is pecurilar (much more
likely). I pass the same set of prefix, bindir and friends to
"make" and "make install" and do not see the problem.
^ permalink raw reply
* Re: [PATCH] git.c: Re-introduce sane error messages on missing commands.
From: Andreas Ericsson @ 2006-06-28 8:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vpsgu6wba.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Andreas Ericsson <ae@op5.se> writes:
>
>
>>Somewhere in the alias handling git turned hostile on fat fingers:
>>
>> $ git showbranch
>> Failed to run command '': Is a directory
>
>
> Does not happen here (nor on Cygwin 1.4.1.rc1). Care to help
> reproducing it?
>
Here's the complete procedure I used:
$ git pull && make; # works ok
$ make strip install; # works ok
$ git showbranch
Failed to run command '': Is a directory
(confusion and puzzlement...)
$ git checkout master; git reset --hard master; # works ok
$ git pull; # gets nothing (I try stupid things first ;p)
$ make clean install; # works ok
$ git showbranch
Failed to run command '': Is a directory
$ git --version
git version 1.4.1.rc1.g1ef9
It's reliably reproducible here. Notable though is that I have no
.git/config in my git.git clone and no ~/.gitconfig (or ~/.gitrc or
whatever), so the handle_alias() function never finds a config file to
look for aliases in.
Either way, removing the variable "char git_command[MAX_PATH + 1];" from
git.c:main() is correct since it's never used for anything but printing
the (erroneous) error message above.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: Quick merge status updates.
From: Johannes Schindelin @ 2006-06-28 7:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0606280928540.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Hi,
on my iBook, make in pu outputs:
GIT_VERSION = 1.4.1.rc1.gf5d3
* new build flags or prefix
(cd perl && /usr/bin/perl Makefile.PL \
PREFIX='/Users/gene099' \
DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\''
-DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
LIBS=' -L/sw/lib -lz -liconv -lcrypto -lssl')
Can't locate Devel/PPPort.pm in @INC (@INC contains:
/System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin
/Library/Perl /Library/Perl /Network/Library/Perl/darwin
/Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
BEGIN failed--compilation aborted at Makefile.PL line 29.
make: *** [perl/Makefile] Error 2
FWIW all Perl scripts in git, except git-send-email, work here.
Ciao,
Dscho
^ permalink raw reply
* Re: Notes on diffcore API
From: Johannes Schindelin @ 2006-06-28 7:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alex Riesen, Timo Hirvonen, git
In-Reply-To: <7vbqse6unx.fsf@assigned-by-dhcp.cox.net>
Hi,
On Tue, 27 Jun 2006, Junio C Hamano wrote:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
> > On 6/27/06, Junio C Hamano <junkio@cox.net> wrote:
> >> -- >8 --
> >> Notes on diffcore API
> >> =====================
> >
> > Thanks!
> >
> >> Diffcore Transformation
> >> -----------------------
> >>
> >> The input file pairs recorded in the previous phase are
> >> collected in diff_queued_diff (a global variable -- which means
> >> that you cannot have two diffs running in parallel with the
> >> current setup). This is an expandable array of pointers to
> >> `struct diff_filepair` structure.
> >>
> >
> > merge-recursive shouldn't have any problems with that, as the
> > renames are just read in the current implementation.
> > Still, it is somehow uncomfortable to see the amount of APIs
> > with the above restriction. Never know when it'll bite.
>
> I think it is simply the matter of moving diff_queued_diff a
> field in diff_optionss structure and adding an extra parameter
> to point at the current diff_options to handful functions if we
> ever need to support it. I haven't bothered doing that because
> we haven't had the need to run more than one diff at once.
And we shouldn't bother until we need it. It has a small performance
impact, and the code gets more ugly.
Ciao,
Dscho
^ permalink raw reply
* Re: CFT: merge-recursive in C
From: Alex Riesen @ 2006-06-28 7:32 UTC (permalink / raw)
To: Uwe Zeisberger, Alex Riesen, git
In-Reply-To: <20060628063747.GA983@informatik.uni-freiburg.de>
On 6/28/06, Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> wrote:
> > +// does not belong here
> Some C compiler (e.g. Sun Forte) don't like C++-style comments.
Yep, I'll change them
^ permalink raw reply
* Re: Quick merge status updates.
From: Johannes Schindelin @ 2006-06-28 7:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vodwe5dr8.fsf@assigned-by-dhcp.cox.net>
Hi,
On Tue, 27 Jun 2006, Junio C Hamano wrote:
> Immediately after 1.4.1 happens, I would like to pull in
> "Git.xs/Git.pm" series by Pasky into "next".
Earlier, you said that this is primarily for gitweb, not so much for the
core of git. But...
> Breakage there would stop your "git pull" working, so this is somewhat
> important.
May I respectfully offer my objection? This is the _heart_ of git. You do
not want to muck around with this.
I am not opposed to a sane interface between Perl and git, but please
please PLEASE do not make such an important part of git dependent on
Git.pm. (Somehow I have the impressions there are echoes here.)
Ciao,
Dscho
^ permalink raw reply
* Re: CFT: merge-recursive in C
From: Uwe Zeisberger @ 2006-06-28 6:37 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
In-Reply-To: <20060626233838.GA3121@steel.home>
Hello Alex,
> +// does not belong here
Some C compiler (e.g. Sun Forte) don't like C++-style comments.
(So the line could read:
/* "//" does not belong here :-) */
)
Best regards
Uwe
--
Uwe Zeisberger
http://www.google.com/search?q=1+degree+celsius+in+kelvin
^ 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