* 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 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
* [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 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 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 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
* 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
* 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: 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: 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: [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
* [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
* [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
* 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
* 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: 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: 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: 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: [PATCH] do not use locale specific strftime when preparing 2822 date
From: Junio C Hamano @ 2006-07-07 19:25 UTC (permalink / raw)
To: jnareb; +Cc: git
In-Reply-To: <e8mb4l$t1u$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
> 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.
I think you are reading ABNF wrong. <a>*<b>element means at least
<a> times and at most <b> times occurrences of element. Exact
number of repetition is written as <n>element (which is a
short-and for <n>*<n>element).
See the definition of "hour" and friends a few lines below what
you quoted. It is defined as "2DIGIT / obs-hour" and that is
why we say "01:23:45" not "1:23:45"
^ permalink raw reply
* Re: [PATCH 0/4] More tests for hand-written configure (resend)
From: Junio C Hamano @ 2006-07-07 19:40 UTC (permalink / raw)
To: Dennis Stosberg; +Cc: git
In-Reply-To: <20060707162513.25746.57374.stgit@leonov.stosberg.net>
Dennis Stosberg <dennis@stosberg.net> writes:
> I noticed that the autoconf-based solution has replaced Pasky's
> scripts in the pu branch. Has a final decision been made?
My preference has been to see both sides battle it out without
forcing me to decide, but...
> 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.
... I started to share the same feeling after Pavel Roskin made
a good point in "git on HP-UX" thread,
http://thread.gmane.org/gmane.comp.version-control.git/23380/focus=23393
and then after seeing the messages in response to your patch
that used `which` from yesterday.
Shell scripts generated by autoconf are almost unreadable, but
the way how they detect features have been polished in the field
for portability for a long time, and there is no point for us to
spend time reinventing the wheel. The configure.ac files are
often quite readable even when generated configure scripts are
not.
So, I would not veto the use of autoconf, as long as configure
stays as an _optional_ mechanism to manage config.mak.gen that
is used by the main Makefile. The users for whom the configure
script breaks for whatever reason can work it around by simply
not using it, instead of having to debug either the unreadable
configure or having to install autoconf and debug configure.ac
just to build git.
The _optional_ is really the key word here. So "make clean" to
clean autoconf intermediate files is good, "make realclean" to
remove "configure" script generated from "configure.ac" is also
good, but if "make rpm" by default runs "configure", then that
is BAD and I would be very unhappy.
I could probably live with "make rpm-using-configure", though.
^ permalink raw reply
* Re: [PATCH] do not use locale specific strftime when preparing 2822 date
From: Jakub Narebski @ 2006-07-07 19:53 UTC (permalink / raw)
To: git
In-Reply-To: <7vveq9w736.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> 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.
>
> I think you are reading ABNF wrong. [...]
>
> See the definition of "hour" and friends a few lines below what
> you quoted. It is defined as "2DIGIT / obs-hour" and that is
> why we say "01:23:45" not "1:23:45"
But it is "day = [...] 2DIGIT [...]"!
Besides, that what other mailers do (I checked the post I replied via
git-send-email to, i.e. your post). Although I don't think that it can
cause any problems, like using locale date with non US-ASCII characters
did...
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] do not use locale specific strftime when preparing 2822 date
From: Jakub Narebski @ 2006-07-07 19:59 UTC (permalink / raw)
To: git
In-Reply-To: <1152298402442-git-send-email-jnareb@gmail.com>
Disregard this email. It was send by mistake by git-send-spam^Wemail.perl
--
Jakub Narebski
^ permalink raw reply
* Re: [PATCH] Fix compilation
From: Junio C Hamano @ 2006-07-07 20:02 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, junkio
In-Reply-To: <Pine.LNX.4.63.0607070120590.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Note also, that this patch relies on the perl scripts not
> caring if an additional command is shifted into the 2nd line.
How about doing something like this instead, then?
diff --git a/Makefile b/Makefile
index 71657ec..01b9a94 100644
--- a/Makefile
+++ b/Makefile
@@ -550,9 +550,13 @@ common-cmds.h: Documentation/git-*.txt
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
rm -f $@ $@+
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
- sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
- -e '2i\
- use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
+ sed -e '1{' \
+ -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
+ -e ' h' \
+ -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
+ -e ' H' \
+ -e ' x' \
+ -e '}' \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@+
^ permalink raw reply related
* Re: [PATCH] do not use locale specific strftime when preparing 2822 date
From: Jakub Narebski @ 2006-07-07 20:01 UTC (permalink / raw)
To: git
In-Reply-To: <7vzmflw7vd.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> 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.
By the way, patch didn't apply cleanly (some fuzz was used).
The patch I send was from _applied_ (to master) patch.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH 2, proof of concept] autoconf: Use %configure in git.spec, autoconf dependency only in rpm target
From: Jakub Narebski @ 2006-07-07 20:06 UTC (permalink / raw)
To: git
In-Reply-To: <1152159397.10415.29.camel@dv>
Pavel Roskin wrote:
> On Tue, 2006-07-04 at 16:09 +0200, Jakub Narebski wrote:
>
>> +Patch0: git-add-autoconf-configure.patch.gz
>
> I don't think we need patches in git.spec.in. Let's leave it to the
> actual distributions. If you have a problem with rpm, please submit the
> autoconf support for now and the rest will be cleaned up eventually.
> Besides, the "next" branch has different and potentially conflicting
> changes to git.spec.in for Git.pm support.
First, it is proof of concept patch, the concept being having autoconf
dependency _only_ in rpm target.
Second, it should be "Source1: autoconf-configure.tar.gz" or something like
that. Using "Patch0:" was an ugly hack.
That to say RPM builders use "PatchN:" for patches which didn't made
upstream; perhaps they make sources more compatibile with distribution RPM
is prepared for.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ 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