Git development
 help / color / mirror / Atom feed
* Re: git2rss --- publish changes from git-log via RSS
From: Matthias Lederhofer @ 2006-07-07 19:23 UTC (permalink / raw)
  To: Bennett Todd, Jakub Narebski; +Cc: git
In-Reply-To: <e8m9m2$m37$1@sea.gmane.org>

Jakub Narebski wrote:
> Bennett Todd wrote:
> 
> > 2006-07-04T21:09:32 Jakub Narebski:
> 
> >> BTW. gitweb includes RSS feed, see e.g.:
> >>   http://www.kernel.org/git/?p=git/git.git;a=rss
> >>   http://www.kernel.org/git/?p=git/git.git;a=opml
> > 
> > Can it be used for offline generation? I don't run any CGIs on my
> > webserver, I re-generate bent.xml whenever I push any updates.
> 
> Just run it as a script. IIRC there is a way to pass CGI params
> to a script...

env REQUEST_METHOD=GET QUERY_STRING='p=git/git.git;a=rss' \
./gitweb.cgi | (read; read; cat)

works fine if gitweb.cgi is setup correctly.

^ permalink raw reply

* Re: Does Git run on Windows ?
From: Jakub Narebski @ 2006-07-07 19:05 UTC (permalink / raw)
  To: git
In-Reply-To: <Pine.LNX.4.63.0607060830060.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin wrote:
 
> On Thu, 6 Jul 2006, Aaron Gray wrote:
>
>> Its got lots of C code, and Bash scripts, with a couple of Perl scripts.
> 
> And you completely forgot Python.

If I remember correctly the only Python dependency was recursive merge
strategy, currently being reworked in C.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: qgit idea: marking refs (heads and tags)
From: Jakub Narebski @ 2006-07-07 19:07 UTC (permalink / raw)
  To: git
In-Reply-To: <e5bfff550607061139y3ccbab37xb83e654d24a19964@mail.gmail.com>

Marco Costalba wrote:

> On 7/4/06, Jakub Narebski <jnareb@gmail.com> wrote:

>>> Something as a typical browser "copy selected link" context menu entry?
>>
>> Yes, "copy sha1 of selected link" would be nice.
>>
> 
> Patch pushed to public repo (git.kernel.org/pub/scm/qgit/qgit.git)

Thanks a lot!

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: [PATCH] do not use locale specific strftime when preparing 2822 date
From: Junio C Hamano @ 2006-07-07 19:08 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <1152298675925-git-send-email-jnareb@gmail.com>

Jakub Narebski <jnareb@gmail.com> writes:

> Signed-off-by: Junio C Hamano <junkio@cox.net>
> Acked-by: Jakub Narebski <jnareb@gmail.com>
> ---
> This patch is sent from patched version of git-send-email.perl
> with git tools 1.3.0. This patch is generated from current master
> after Junio's patch 
>   Message-ID: <7vd5cnv1v5.fsf@assigned-by-dhcp.cox.net>
> applied.

Good test.  Thanks.

^ permalink raw reply

* Re: [PATCH] do not use locale specific strftime when preparing 2822 date
From: Jakub Narebski @ 2006-07-07 19:03 UTC (permalink / raw)
  To: git
In-Reply-To: <1152298675925-git-send-email-jnareb@gmail.com>

It looks like it is _almost_ correct. It should be
  Date: Fri, 07 Jul 2006 20:57:55 +0200
instead of
  Date: Fri,  7 Jul 2006 20:57:55 +0200

It is "day = ([FWS] 1*2DIGIT) / obs-day" in RFC2822.

-- 
Jakub Narebski

^ permalink raw reply

* [PATCH] do not use locale specific strftime when preparing 2822 date
From: Jakub Narebski @ 2006-07-07 18:57 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski, Junio C Hamano
In-Reply-To: <7vlkr7bvc1.fsf@assigned-by-dhcp.cox.net>

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is sent from patched version of git-send-email.perl
with git tools 1.3.0. This patch is generated from current master
after Junio's patch 
  Message-ID: <7vd5cnv1v5.fsf@assigned-by-dhcp.cox.net>
applied.

 git-send-email.perl |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

f00ff14faf86c376d0ffb3cef24d2e5a5437dfcf
diff --git a/git-send-email.perl b/git-send-email.perl
index b04b8f4..c9c1975 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -34,8 +34,43 @@ sub readline {
 package main;
 
 # most mail servers generate the Date: header, but not all...
-$ENV{LC_ALL} = 'C';
-use POSIX qw/strftime/;
+sub format_2822_time {
+	my ($time) = @_;
+	my @localtm = localtime($time);
+	my @gmttm = gmtime($time);
+	my $localmin = $localtm[1] + $localtm[2] * 60;
+	my $gmtmin = $gmttm[1] + $gmttm[2] * 60;
+	if ($localtm[0] != $gmttm[0]) {
+		die "local zone differs from GMT by a non-minute interval\n";
+	}
+	if ((($gmttm[6] + 1) % 7) == $localtm[6]) {
+		$localmin += 1440;
+	} elsif ((($gmttm[6] - 1) % 7) == $localtm[6]) {
+		$localmin -= 1440;
+	} elsif ($gmttm[6] != $localtm[6]) {
+		die "local time offset greater than or equal to 24 hours\n";
+	}
+	my $offset = $localmin - $gmtmin;
+	my $offhour = $offset / 60;
+	my $offmin = abs($offset % 60);
+	if (abs($offhour) >= 24) {
+		die ("local time offset greater than or equal to 24 hours\n");
+	}
+
+	return sprintf("%s, %2d %s %d %02d:%02d:%02d %s%02d%02d",
+		       qw(Sun Mon Tue Wed Thu Fri Sat)[$localtm[6]],
+		       $localtm[3],
+		       qw(Jan Feb Mar Apr May Jun
+			  Jul Aug Sep Oct Nov Dec)[$localtm[4]],
+		       $localtm[5]+1900,
+		       $localtm[2],
+		       $localtm[1],
+		       $localtm[0],
+		       ($offset >= 0) ? '+' : '-',
+		       abs($offhour),
+		       $offmin,
+		       );
+}
 
 my $have_email_valid = eval { require Email::Valid; 1 };
 my $smtp;
@@ -387,7 +422,7 @@ sub send_message
 	my @recipients = unique_email_list(@to);
 	my $to = join (",\n\t", @recipients);
 	@recipients = unique_email_list(@recipients,@cc,@bcclist);
-	my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
+	my $date = format_2822_time($time++);
 	my $gitversion = '@@GIT_VERSION@@';
 	if ($gitversion =~ m/..GIT_VERSION../) {
 	    $gitversion = `git --version`;
-- 
1.3.0

^ permalink raw reply related

* [PATCH] do not use locale specific strftime when preparing 2822 date
From: Jakub Narebski @ 2006-07-07 18:53 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

---

 git-send-email.perl |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

f00ff14faf86c376d0ffb3cef24d2e5a5437dfcf
diff --git a/git-send-email.perl b/git-send-email.perl
index b04b8f4..c9c1975 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -34,8 +34,43 @@ sub readline {
 package main;
 
 # most mail servers generate the Date: header, but not all...
-$ENV{LC_ALL} = 'C';
-use POSIX qw/strftime/;
+sub format_2822_time {
+	my ($time) = @_;
+	my @localtm = localtime($time);
+	my @gmttm = gmtime($time);
+	my $localmin = $localtm[1] + $localtm[2] * 60;
+	my $gmtmin = $gmttm[1] + $gmttm[2] * 60;
+	if ($localtm[0] != $gmttm[0]) {
+		die "local zone differs from GMT by a non-minute interval\n";
+	}
+	if ((($gmttm[6] + 1) % 7) == $localtm[6]) {
+		$localmin += 1440;
+	} elsif ((($gmttm[6] - 1) % 7) == $localtm[6]) {
+		$localmin -= 1440;
+	} elsif ($gmttm[6] != $localtm[6]) {
+		die "local time offset greater than or equal to 24 hours\n";
+	}
+	my $offset = $localmin - $gmtmin;
+	my $offhour = $offset / 60;
+	my $offmin = abs($offset % 60);
+	if (abs($offhour) >= 24) {
+		die ("local time offset greater than or equal to 24 hours\n");
+	}
+
+	return sprintf("%s, %2d %s %d %02d:%02d:%02d %s%02d%02d",
+		       qw(Sun Mon Tue Wed Thu Fri Sat)[$localtm[6]],
+		       $localtm[3],
+		       qw(Jan Feb Mar Apr May Jun
+			  Jul Aug Sep Oct Nov Dec)[$localtm[4]],
+		       $localtm[5]+1900,
+		       $localtm[2],
+		       $localtm[1],
+		       $localtm[0],
+		       ($offset >= 0) ? '+' : '-',
+		       abs($offhour),
+		       $offmin,
+		       );
+}
 
 my $have_email_valid = eval { require Email::Valid; 1 };
 my $smtp;
@@ -387,7 +422,7 @@ sub send_message
 	my @recipients = unique_email_list(@to);
 	my $to = join (",\n\t", @recipients);
 	@recipients = unique_email_list(@recipients,@cc,@bcclist);
-	my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
+	my $date = format_2822_time($time++);
 	my $gitversion = '@@GIT_VERSION@@';
 	if ($gitversion =~ m/..GIT_VERSION../) {
 	    $gitversion = `git --version`;
-- 
1.3.0

^ permalink raw reply related

* Re: [PATCH] Add "raw" output option to blobs in "tree" view format
From: Junio C Hamano @ 2006-07-07 18:45 UTC (permalink / raw)
  To: ltuikov; +Cc: git
In-Reply-To: <20060707164152.86022.qmail@web31805.mail.mud.yahoo.com>

Luben Tuikov <ltuikov@yahoo.com> writes:

> That is, the user would still have to click through "tree->blob->plain"
> to download a "text/*" file, as opposed to just "tree->raw".
>
> What this patch allows, is that the user be able to simply download the file,
> right from "tree" view, regardless of the type of file. (I.e. the type of
> file as decided by the _user_, not gitweb.cgi.)

OK, I see what you are aiming at.

I have been irritated by the current git_blob that always seems
to do "cat -n" even for non text/* files, but you are tackling
the opposite problem.

^ permalink raw reply

* Re: Why's Git called Git ?
From: Jakub Narebski @ 2006-07-07 18:40 UTC (permalink / raw)
  To: git
In-Reply-To: <01f201c6a0a2$6faa0f80$0200a8c0@AMD2500>

Aaron Gray wrote:

>> I really like notion of branching in Git; but be warned about tracking and
>> not recording renames, and the need of explicit packing (the latter very
>> minor). Powerfull, perhaps too powerfull for newbie user: but that is what
>> Cogito is for (although now Git contains fairly large set of high-level
>> commands).
> 
> We like to move forward.

What I like a lot in Git is very easy switching of working area between 
branches, and to arbitrary commit (point in history).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: git2rss --- publish changes from git-log via RSS
From: Jakub Narebski @ 2006-07-07 18:38 UTC (permalink / raw)
  To: git
In-Reply-To: <20060706125328.GA19414@rahul.net>

Bennett Todd wrote:

> 2006-07-04T21:09:32 Jakub Narebski:

>> BTW. gitweb includes RSS feed, see e.g.:
>>   http://www.kernel.org/git/?p=git/git.git;a=rss
>>   http://www.kernel.org/git/?p=git/git.git;a=opml
> 
> Can it be used for offline generation? I don't run any CGIs on my
> webserver, I re-generate bent.xml whenever I push any updates.

Just run it as a script. IIRC there is a way to pass CGI params
to a script...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: comparing file contents in is_exact_match?
From: Florian Weimer @ 2006-07-07 16:33 UTC (permalink / raw)
  To: git
In-Reply-To: <20060706055729.GA12512@admingilde.org>

* Martin Waitz:

> I created a git repository for my photo collection and then renamed
> some photos (about 600).  Now git status and commit get hit by
> the OOM killer.
>
> The reason for that is that is_exact_match (in diffcore-rename.c) maps
> both the source and destination file into memory and then compares them
> byte for byte.  This is a little bit too much for my little machine.

Uhm, this shouldn't trigger the OOM killer, really.  You already have
physical backing storage for both files, so this shouldn't count
towards the OOM limit.  Ah, diff_populate_filespec has the following:

   s->data = mmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0);

Perhaps the following patch is in order?  On some systems, MAP_PRIVATE
might guarantee some form of repeatable reads, but I don't think GIT
needs this to guard against concurrent modification.

-- >8 --
diff_populate_filespec: use shared mapping

It seems that on some systems, PROT_READ + MAP_PRIVATE counts towards
the OOM limit, even though no additional backing store is required.
Requesting MAP_SHARED mapping should fix this.

Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
---
 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff.c b/diff.c
index 428ff78..2b4367e 100644
--- a/diff.c
+++ b/diff.c
@@ -1007,7 +1007,7 @@ int diff_populate_filespec(struct diff_f
                fd = open(s->path, O_RDONLY);
                if (fd < 0)
                        goto err_empty;
-               s->data = mmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0);
+               s->data = mmap(NULL, s->size, PROT_READ, MAP_SHARED, fd, 0);
                close(fd);
                if (s->data == MAP_FAILED)
                        goto err_empty;
--
1.4.0

^ permalink raw reply related

* Re: [PATCH] Add "raw" output option to blobs in "tree" view format
From: Luben Tuikov @ 2006-07-07 16:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vmzbl3nqj.fsf@assigned-by-dhcp.cox.net>

--- Junio C Hamano <junkio@cox.net> wrote:
> Luben Tuikov <ltuikov@yahoo.com> writes:
> 
> > Add a "raw" output option to blobs in "tree" view format, so that the
> > user doesn't have to click on "blob", wait for the (binary) file to be
> > uploaded and shown in "blob" mode, and then click on "plain" to
> > download the (binary) file.
> 
> I appreciate what you are trying to achieve, but at the same
> time wonder if it would make more sense to simply teach a=blob
> action to do this automatically, perhaps using /etc/mime.types
> and/or File::MMagic.

That'd be cool for non-"text/*" files, but it would leave the user
go through the same click "tree->blob->plain" for "text/*" files,
since they are "cat -n"-able and the default action would be git_blob()
if such an algorithm is implemented.

That is, the user would still have to click through "tree->blob->plain"
to download a "text/*" file, as opposed to just "tree->raw".

What this patch allows, is that the user be able to simply download the file,
right from "tree" view, regardless of the type of file. (I.e. the type of
file as decided by the _user_, not gitweb.cgi.)

Having said that, we can still implement it, so that "raw"="blob" for
non-"text/*" files, but "raw"!="blob" for "text/*" files.  I.e. allow
the "cat -n" functionality for "text/*" files, as is currently implemented,
as well as shortcut for downloading ("raw").

> If you know your MUA will mangle whitespace to make your patch
> inapplicable, please do not add a patch to the message _and_
> attach the patch to the message.  The mail-acceptance tools know
> how to flatten MIME attachments, but if you have your log,
> three-dash and then corrupt patch in the cover-letter part, and
> then the true patch in the attachment part, the flattened result
> will have the corrupt patch first to cause the patch application
> to fail.  So please either (preferably) use a MUA that does not
> corrupt your patches, or do a log in the message part with patch
> only as attachment.

Will do.

    Luben

^ permalink raw reply

* [PATCH 4/4] configure: Fixes for Solaris
From: Dennis Stosberg @ 2006-07-07 16:26 UTC (permalink / raw)
  To: git
In-Reply-To: <20060707162513.25746.57374.stgit@leonov.stosberg.net>

From: Dennis Stosberg <dennis@stosberg.net>

- Solaris' /bin/sh will not find a function if there is a variable 
  with the same name.
- 'test -z $var' fails if $var is empty.  Needs to be 'test -z "$var"' 

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---

 config-lib.sh |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/config-lib.sh b/config-lib.sh
index 0bcd4c3..4dd4d00 100755
--- a/config-lib.sh
+++ b/config-lib.sh
@@ -181,7 +181,7 @@ add_library() { # --with
 	lib_help="$lib_help
 $desc [$hdefault]"
 	switches="$switches switch_lib \"$name\" \"$switch\" \"\$ac_option\" || "
-	mkvars="$mkvars mkvar \"\$$name\" \"$mkvar\";"
+	mkvars="$mkvars print_mkvar \"\$$name\" \"$mkvar\";"
 	eval "$name=$default"
 }
 
@@ -196,7 +196,7 @@ add_feature() { # --enable
 	feature_help="$feature_help
 $desc [$hdefault]"
 	switches="$switches switch_feature \"$name\" \"$switch\" \"\$ac_option\" || "
-	mkvars="$mkvars mkvar \"\$$name\" \"$mkvar\";"
+	mkvars="$mkvars print_mkvar \"\$$name\" \"$mkvar\";"
 	eval "$name=$default"
 }
 
@@ -226,7 +226,7 @@ switch_feature() {
 	return 0
 }
 
-mkvar() {
+print_mkvar() {
 	value="$1"; shift; mkvar="$1"; shift
 	noval=""; yesval="ConfigureYesPlease"
 	case $mkvar in
@@ -533,15 +533,15 @@ PERL_PATH = $_perl
 INSTALL = $_install
 
 EOF
-		test -z $_prefix || echo "prefix = $_prefix"
-		test -z $_bindir || echo "bindir = $_bindir"
-		test -z $_gitexecdir || echo "gitexecdir = $_gitexecdir"
-		test -z $_mandir || ( echo "mandir = $_mandir" && echo "export mandir" )
-		test -z $_templatedir || echo "template_dir = $_templatedir"
-		test -z $_gitpythondir || echo "GIT_PYTHON_DIR = $_gitpythondir"
-
-		test -z $_python || echo "PYTHON_PATH = $_python"
-		test -z $_no_python || echo "NO_PYTHON = $_no_python"
+		test -z "$_prefix" || echo "prefix = $_prefix"
+		test -z "$_bindir" || echo "bindir = $_bindir"
+		test -z "$_gitexecdir" || echo "gitexecdir = $_gitexecdir"
+		test -z "$_mandir" || ( echo "mandir = $_mandir" && echo "export mandir" )
+		test -z "$_templatedir" || echo "template_dir = $_templatedir"
+		test -z "$_gitpythondir" || echo "GIT_PYTHON_DIR = $_gitpythondir"
+
+		test -z "$_python" || echo "PYTHON_PATH = $_python"
+		test -z "$_no_python" || echo "NO_PYTHON = $_no_python"
 
 		echo
 		eval "$mkvars"

^ permalink raw reply related

* [PATCH 2/4] configure: Add test for Python
From: Dennis Stosberg @ 2006-07-07 16:26 UTC (permalink / raw)
  To: git
In-Reply-To: <20060707162513.25746.57374.stgit@leonov.stosberg.net>

From: Dennis Stosberg <dennis@stosberg.net>

The test tries to find the path to a suitable Python binary.  The
user can override the auto-detection with the --python parameter
or with the PYTHON environment variable.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---

 config-lib.sh |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/config-lib.sh b/config-lib.sh
index 34dfc05..3968245 100755
--- a/config-lib.sh
+++ b/config-lib.sh
@@ -259,6 +259,9 @@ process_params() {
 	_perl=
 	test "$PERL" && _perl="$PERL"
 
+	_python=
+	test "$PYTHON" && _python="$PYTHON"
+
 	for ac_option do
 		case "$ac_option" in
 		--help|-help|-h)
@@ -282,6 +285,7 @@ Installation directories:
 Miscellaneous options:
   --cc=COMPILER          use this C compiler to build MPlayer [gcc]
   --perl=PATH            path to perl binary [autodetect]
+  --python=PATH          path to python binary [autodetect]
   --target=PLATFORM      target platform (i386-linux, arm-linux, etc)
   --with-install=PATH    use a custom install program (useful if your OS uses
                          a GNU-incompatible install utility by default and
@@ -318,6 +322,8 @@ EOF
 			_cc=`echo $ac_option | cut -d '=' -f 2` ;;
 		--perl=*)
 			_perl=`echo $ac_option | cut -d '=' -f 2` ;;
+		--python=*)
+			_python=`echo $ac_option | cut -d '=' -f 2` ;;
 		--target=*)
 			_target=`echo $ac_option | cut -d '=' -f 2` ;;
 		--with-install=*)
@@ -445,6 +451,28 @@ EOF
 		die "your perl is too old. Perl 5.6.0 or newer is required."
 	fi
 	echores "$_perl_version"
+
+	echocheck "for python"
+	for _py_bin in python python2.4 python2.3; do
+		test "$_python" && continue
+
+		_candidate=`path_find $_py_bin`
+		test "$_candidate" || continue
+
+		$_candidate - <<EOF || continue
+import sys
+v = sys.version_info
+if v < (2, 3):
+    sys.exit(1)
+EOF
+		_python=$_candidate
+	done
+	if test "$_python"; then
+		echores "$_python"
+	else
+		_no_python="ConfigureYesPlease"
+		echores "not found"
+	fi
 }
 
 write_config() {
@@ -465,6 +493,10 @@ EOF
 		test -z $_mandir || ( echo "mandir = $_mandir" && echo "export mandir" )
 		test -z $_templatedir || echo "template_dir = $_templatedir"
 		test -z $_gitpythondir || echo "GIT_PYTHON_DIR = $_gitpythondir"
+
+		test -z $_python || echo "PYTHON_PATH = $_python"
+		test -z $_no_python || echo "NO_PYTHON = $_no_python"
+
 		echo
 		eval "$mkvars"
 	} > config.mak.autogen

^ permalink raw reply related

* [PATCH 3/4] configure: Try to figure out compiler options
From: Dennis Stosberg @ 2006-07-07 16:26 UTC (permalink / raw)
  To: git
In-Reply-To: <20060707162513.25746.57374.stgit@leonov.stosberg.net>

From: Dennis Stosberg <dennis@stosberg.net>

This patch adds tests to determine of what flavour the used
compiler is and sets CFLAGS and the PIC flag appropriately.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---

 Makefile      |    3 ++-
 config-lib.sh |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 4dc5379..23c784e 100644
--- a/Makefile
+++ b/Makefile
@@ -96,6 +96,7 @@ ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 PERL_CFLAGS =
 PERL_LDFLAGS =
+PICFLAG = -fPIC
 STRIP ?= strip
 
 prefix = $(HOME)
@@ -483,7 +484,7 @@ endif
 endif
 endif
 ifdef USE_PIC
-	ALL_CFLAGS += -fPIC
+	ALL_CFLAGS += $(PICFLAG)
 endif
 ifdef NO_ACCURATE_DIFF
 	BASIC_CFLAGS += -DNO_ACCURATE_DIFF
diff --git a/config-lib.sh b/config-lib.sh
index 3968245..0bcd4c3 100755
--- a/config-lib.sh
+++ b/config-lib.sh
@@ -35,9 +35,9 @@ compile_check() {
 	echo
 	cat "$1"
 	echo
-	echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@"
+	echo "$_cc $_cflags $_inc_extra $_ld_static $_ld_extra -o $TMPO $@"
 	rm -f "$TMPO"
-	$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" || return $?
+	$_cc $_cflags $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" || return $?
 	echo
 	echo "ldd $TMPO"
 	$_ldd "$TMPO" || return $?
@@ -283,7 +283,7 @@ Installation directories:
   --gitpythondir=DIR     use this prefix for python libraries [PREFIX/share/git-core/python]
 
 Miscellaneous options:
-  --cc=COMPILER          use this C compiler to build MPlayer [gcc]
+  --cc=COMPILER          use this C compiler to build Git [cc]
   --perl=PATH            path to perl binary [autodetect]
   --python=PATH          path to python binary [autodetect]
   --target=PLATFORM      target platform (i386-linux, arm-linux, etc)
@@ -373,8 +373,8 @@ EOF
 				i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
 				ia64) host_arch=ia64 ;;
 				x86_64|amd64)
-				if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
-					-z "`echo $CFLAGS | grep -- -m32`"  ]; then
+				if [ -n "`$_cc -dumpmachine 2>/dev/null | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
+					-z "`echo $_cflags | grep -- -m32`"  ]; then
 					host_arch=x86_64
 				else
 					host_arch=i386
@@ -430,7 +430,51 @@ test_setup() {
 	TMPS="$I/git-conf-$RANDOM-$$.S"
 }
 
+cc_flavour() {
+
+	echocheck "whether cc is GCC"
+	cat > $TMPC <<EOF
+#ifndef __GNUC__
+#error Not GCC
+#endif
+int main(void) { return 0; }
+EOF
+	if cc_check ; then
+		echores "yes"
+		_cc_flavour="gcc"
+		return
+	fi
+	echores "no"
+
+	echocheck "whether cc is Sun CC"
+	cat > $TMPC <<EOF
+#ifndef __SUNPRO_C
+#error Not SUN CC
+#endif
+int main(void) { return 0; }
+EOF
+	if cc_check ; then
+		echores "yes"
+		_cc_flavour="suncc"
+		return
+	fi
+	echores "no"
+}
+
 basic_tests() {
+	_cc_flavour=unknown
+	cc_flavour
+
+	if test "$_cc_flavour" = "gcc" ; then
+		_cflags="-g -O2 -Wall"
+		_picflag="-fPIC"
+	elif test "$_cc_flavour" = "suncc"; then
+		_cflags="-g -xO3"
+		_picflag="-KPIC"
+	fi
+	test "$CFLAGS" && _cflags="$CFLAGS"
+	test "$PICFLAG" && _picflag="$PICFLAG"
+
 	echocheck "if your build environment is sane"
 	cat > $TMPC <<EOF
 int main(void) { return 0; }
@@ -483,6 +527,8 @@ write_config() {
 # -------- Generated by configure -----------
 
 CC = $_cc
+CFLAGS = $_cflags
+PICFLAG = $_picflag
 PERL_PATH = $_perl
 INSTALL = $_install
 

^ permalink raw reply related

* [PATCH 1/4] configure: Add test for Perl
From: Dennis Stosberg @ 2006-07-07 16:26 UTC (permalink / raw)
  To: git
In-Reply-To: <20060707162513.25746.57374.stgit@leonov.stosberg.net>

From: Dennis Stosberg <dennis@stosberg.net>

This patch adds two tests to the configuration script. The first
one tries to find a perl binary in the path.  The second one checks
whether the found perl is of a sufficient version.

The user can override the auto-detection with the --perl parameter
or with the PERL environment variable.

The path_find() function was written by Timo Hirvonen as a replacement
for "which", which cannot be used portably.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---

 config-lib.sh |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/config-lib.sh b/config-lib.sh
index 68fecc5..34dfc05 100755
--- a/config-lib.sh
+++ b/config-lib.sh
@@ -117,6 +117,22 @@ alpha() {
 	esac
 }
 
+# replacement for "which", which cannot be used portably
+path_find()
+{
+        _ifs="$IFS"
+        IFS=:
+        for i in $PATH; do
+                if test -x "$i/$1"; then
+                        IFS="$_ifs"
+                        echo "$i/$1"
+                        return 0
+                fi
+        done
+        IFS="$_ifs"
+        return 1
+}
+
 # not boolean test: implement the posix shell "!" operator for a
 # non-posix /bin/sh.
 #   usage:  not {command}
@@ -240,6 +256,9 @@ process_params() {
 	_cc=cc
 	test "$CC" && _cc="$CC"
 
+	_perl=
+	test "$PERL" && _perl="$PERL"
+
 	for ac_option do
 		case "$ac_option" in
 		--help|-help|-h)
@@ -262,6 +281,7 @@ Installation directories:
 
 Miscellaneous options:
   --cc=COMPILER          use this C compiler to build MPlayer [gcc]
+  --perl=PATH            path to perl binary [autodetect]
   --target=PLATFORM      target platform (i386-linux, arm-linux, etc)
   --with-install=PATH    use a custom install program (useful if your OS uses
                          a GNU-incompatible install utility by default and
@@ -296,6 +316,8 @@ EOF
 
 		--cc=*)
 			_cc=`echo $ac_option | cut -d '=' -f 2` ;;
+		--perl=*)
+			_perl=`echo $ac_option | cut -d '=' -f 2` ;;
 		--target=*)
 			_target=`echo $ac_option | cut -d '=' -f 2` ;;
 		--with-install=*)
@@ -409,8 +431,21 @@ int main(void) { return 0; }
 EOF
 	{ cc_check && tmp_run; } || die "unusable compiler or produced binary"
 	echores yes
-}
 
+	echocheck "for perl"
+	if test -z "$_perl" ; then
+		_perl=`path_find perl`
+		test "$_perl" || die "cannot find path to perl"
+	fi
+	echores "$_perl"
+
+	echocheck "perl version"
+	_perl_version=`"$_perl" -e 'eval{require 5.6.0; printf "%vd", $^V}'`
+	if test -z "$_perl_version" ; then
+		die "your perl is too old. Perl 5.6.0 or newer is required."
+	fi
+	echores "$_perl_version"
+}
 
 write_config() {
 	echo "Creating config.mak.autogen"
@@ -420,6 +455,7 @@ write_config() {
 # -------- Generated by configure -----------
 
 CC = $_cc
+PERL_PATH = $_perl
 INSTALL = $_install
 
 EOF

^ permalink raw reply related

* [PATCH 0/4] More tests for hand-written configure (resend)
From: Dennis Stosberg @ 2006-07-07 16:25 UTC (permalink / raw)
  To: git

Second version of the additional tests.  Changes relative to
yesterdays's patches:

  -  Calls to the "which" command have been replaced by a shell
     function that Timo Hirvonen has written
  -  Paths to Perl and Python binaries can be given in an
     environment variable to prevent auto-detection.
  -  NO_PYTHON is set, if no suitable python can be found
  -  Fixes to make it run on Solaris.

Tested on Linux (bash, dash), Solaris 9 (sh) and NetBSD (sh/ash).

I noticed that the autoconf-based solution has replaced Pasky's
scripts in the pu branch.  Has a final decision been made?

I must admit that I'm less convinced today that a hand-written
configuration script is better than I was yesterday when I started
to write the tests.

Regards,
Dennis

^ permalink raw reply

* Re: fatal: ambiguous argument '': unknown revision or path not in the working tree.
From: Anand Kumria @ 2006-07-07 14:54 UTC (permalink / raw)
  To: git
In-Reply-To: <44AE4B02.2050408@logix.cz>

On Fri, 07 Jul 2006 23:52:34 +1200, Michal Ludvig wrote:

> Hi all,
> 
> I'm getting this error from most cogito commands in my repository
> (created with cg-init):

[snip]

> Using cogito-0.17 and git-1.4.0

You need to upgrade to cogito-0.17.2 with git-1.4.0

Cheers,
Anand

^ permalink raw reply

* [PATCH 1/3] Teach diff -a as shorthand for --text
From: Stephan Feder @ 2006-07-07 13:57 UTC (permalink / raw)
  To: git
In-Reply-To: <44AE4B35.6060607@b-i-t.de>

Signed-off-by: Stephan Feder <sf@b-i-t.de>
---
 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff.c b/diff.c
index 1f0219d..b423491 100644
--- a/diff.c
+++ b/diff.c
@@ -1561,7 +1561,7 @@ int diff_opt_parse(struct diff_options *
 		options->output_format |= DIFF_FORMAT_PATCH;
 		options->full_index = options->binary = 1;
 	}
-	else if (!strcmp(arg, "--text")) {
+	else if (!strcmp(arg, "-a") || !strcmp(arg, "--text")) {
 		options->text = 1;
 	}
 	else if (!strcmp(arg, "--name-only"))
-- 
1.4.1.gbc483

^ permalink raw reply related

* [PATCH 2/3] Add -a and --text to common diff options help
From: Stephan Feder @ 2006-07-07 13:57 UTC (permalink / raw)
  To: git
In-Reply-To: <44AE4B35.6060607@b-i-t.de>

Signed-off-by: Stephan Feder <sf@b-i-t.de>
---
 diff.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/diff.h b/diff.h
index f80f646..8ab0448 100644
--- a/diff.h
+++ b/diff.h
@@ -162,7 +162,8 @@ #define COMMON_DIFF_OPTIONS_HELP \
 "  -O<file>      reorder diffs according to the <file>.\n" \
 "  -S<string>    find filepair whose only one side contains the string.\n" \
 "  --pickaxe-all\n" \
-"                show all files diff when -S is used and hit is found.\n"
+"                show all files diff when -S is used and hit is found.\n" \
+"  -a  --text    treat all files as text.\n"
 
 extern int diff_queue_is_empty(void);
 extern void diff_flush(struct diff_options*);
-- 
1.4.1.gbc483

^ permalink raw reply related

* [PATCH 3/3] diff-options: Explain --text and -a
From: Stephan Feder @ 2006-07-07 13:57 UTC (permalink / raw)
  To: git
In-Reply-To: <44AE4B35.6060607@b-i-t.de>

Signed-off-by: Stephan Feder <sf@b-i-t.de>
---
 Documentation/diff-options.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index f523ec2..1a93629 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -94,5 +94,11 @@
 	Swap two inputs; that is, show differences from index or
 	on-disk file to tree contents.
 
+--text::
+	Treat all files as text.
+
+-a::
+	Shorthand for "--text".
+
 For more detailed explanation on these common options, see also
 link:diffcore.html[diffcore documentation].
-- 
1.4.1.gbc483

^ permalink raw reply related

* Re: [PATCH] Makefile: export NO_SVN_TESTS
From: Junio C Hamano @ 2006-07-07 12:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0607071326030.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Without this patch, it really is not sufficient to define NO_SVN_TESTS
> in config.mak or the Makefile.

Good catch.  I never use config.mak but always use the make
wrapper approach, so I did not notice it.

Thanks.

^ permalink raw reply

* [PATCH] update Documentation/diff-options.txt
From: Junio C Hamano @ 2006-07-07 12:30 UTC (permalink / raw)
  To: git
In-Reply-To: <7vpsghzmr1.fsf@assigned-by-dhcp.cox.net>

We've been lazy and left things undocumented for some time.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Documentation/diff-options.txt |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index f523ec2..fdcfd68 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -4,18 +4,21 @@
 -u::
 	Synonym for "-p".
 
+--raw::
+	Generate the raw format.
+
 --patch-with-raw::
-	Generate patch but keep also the default raw diff output.
+	Synonym for "-p --raw".
 
 --stat::
-	Generate a diffstat instead of a patch.
+	Generate a diffstat.
 
 --summary::
 	Output a condensed summary of extended header information
 	such as creations, renames and mode changes.
 
 --patch-with-stat::
-	Generate patch and prepend its diffstat.
+	Synonym for "-p --stat".
 
 -z::
 	\0 line termination on output
@@ -26,11 +29,26 @@
 --name-status::
 	Show only names and status of changed files.
 
+--color::
+	Show colored diff.
+
+--no-color::
+	Turn off colored diff, even when the configuration file
+	gives the default to color output.
+
+--no-renames::
+	Turn off rename detection, even when the configuration
+	file gives the default to do so.
+
 --full-index::
 	Instead of the first handful characters, show full
 	object name of pre- and post-image blob on the "index"
 	line when generating a patch format output.	
 
+--binary::
+	In addition to --full-index, output "binary diff" that
+	can be applied with "git apply".
+
 --abbrev[=<n>]::
 	Instead of showing the full 40-byte hexadecimal object
 	name in diff-raw format output and diff-tree header
-- 
1.4.1.gfff4c

^ permalink raw reply related

* Re: [PATCH] diff.c: respect diff.renames config option
From: Junio C Hamano @ 2006-07-07 12:29 UTC (permalink / raw)
  To: Eric Wong; +Cc: git
In-Reply-To: <7vpsghzmr1.fsf@assigned-by-dhcp.cox.net>

In the same spirit...

From: Junio C Hamano <junkio@cox.net>
Date: Fri, 7 Jul 2006 05:27:24 -0700
Subject: [PATCH] diff.c: --no-color to defeat diff.color configuration.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 diff.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/diff.c b/diff.c
index 2534fce..39e608f 100644
--- a/diff.c
+++ b/diff.c
@@ -1622,6 +1622,8 @@ int diff_opt_parse(struct diff_options *
 	}
 	else if (!strcmp(arg, "--color"))
 		options->color_diff = 1;
+	else if (!strcmp(arg, "--no-color"))
+		options->color_diff = 0;
 	else if (!strcmp(arg, "-w") || !strcmp(arg, "--ignore-all-space"))
 		options->xdl_opts |= XDF_IGNORE_WHITESPACE;
 	else if (!strcmp(arg, "-b") || !strcmp(arg, "--ignore-space-change"))
-- 
1.4.1.gfff4c

^ permalink raw reply related

* Re: [PATCH] diff.c: respect diff.renames config option
From: Junio C Hamano @ 2006-07-07 12:17 UTC (permalink / raw)
  To: Eric Wong; +Cc: git
In-Reply-To: <7vpsghzmr1.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> writes:

> I am more worried about somebody who opts-in finds breakage of
> commands that happen to internally use low-level diff machinery
> and expect the diff machinery does not automagically do funny
> rename detection without being told.
> ...
> That is why I said I do not want this at _that_ low level.  I do
> not have objections to have the configuration at a layer closer
> to the UI, e.g. things in builtin-log.c and builtin-diff.c.

Upon closer look I think the revision pruning code is OK.  So
let's cook this as is in "next" and see what happens.

^ permalink raw reply


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