* [DIFF] build git on armv6l emulator with uclibc
From: Tito @ 2009-09-12 20:18 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 630 bytes --]
Hi,
this by no means could be considered a patch, it is only a
report of the modifications i had to make to git-1.6.4.2
sources in order to build it with uClibc-0.9.30.1 in Rob Landley's
Firmware Linux 0.9.7 in a armv6l qemu emulator.
The major problem really was to get perl to build.
I've tested git (mainly git pull as it is the only thing I really
need in this case) and it seems to work fine.
Attached you'll find a diff and my config.log.
Maybe some more experienced developer with better knowledge
of Makefile/autoconf voodoo could use this to add uClibc support
to git if there is a interest.
Best regards and Ciao,
Tito
[-- Attachment #2: git_uclibc_on_armv6l.diff --]
[-- Type: text/x-diff, Size: 1593 bytes --]
signed off by Tito Ragusa <farmatito@tiscali.it>
--- builtin-fetch-pack.c.orig 2009-08-29 23:58:52.000000000 +0200
+++ builtin-fetch-pack.c 2009-09-12 11:47:00.000000000 +0200
@@ -813,7 +813,11 @@
int fd;
mtime.sec = st.st_mtime;
+#if 0
mtime.nsec = ST_MTIME_NSEC(st);
+#else
+ mtime.nsec = (unsigned long int)st.st_mtimensec;
+#endif
if (stat(shallow, &st)) {
if (mtime.sec)
die("shallow file was removed during fetch");
--- read-cache.c.orig 2009-08-29 23:58:52.000000000 +0200
+++ read-cache.c 2009-09-12 22:04:22.000000000 +0200
@@ -69,8 +69,13 @@
{
ce->ce_ctime.sec = (unsigned int)st->st_ctime;
ce->ce_mtime.sec = (unsigned int)st->st_mtime;
+#if 0
ce->ce_ctime.nsec = ST_CTIME_NSEC(*st);
ce->ce_mtime.nsec = ST_MTIME_NSEC(*st);
+#else
+ ce->ce_ctime.nsec = (unsigned long int)st->st_ctimensec;
+ ce->ce_mtime.nsec = (unsigned long int)st->st_mtimensec;
+#endif
ce->ce_dev = st->st_dev;
ce->ce_ino = st->st_ino;
ce->ce_uid = st->st_uid;
@@ -1299,7 +1304,11 @@
dst_offset += ce_size(ce);
}
istate->timestamp.sec = st.st_mtime;
+#if 0
istate->timestamp.nsec = ST_MTIME_NSEC(st);
+#else
+ istate->timestamp.nsec = (unsigned long int)st.st_mtimensec;
+#endif
while (src_offset <= mmap_size - 20 - 8) {
/* After an array of active_nr index entries,
@@ -1564,7 +1573,11 @@
if (ce_flush(&c, newfd) || fstat(newfd, &st))
return -1;
istate->timestamp.sec = (unsigned int)st.st_mtime;
+#if 0
istate->timestamp.nsec = ST_MTIME_NSEC(st);
+#else
+ istate->timestamp.nsec = (unsigned long int)st.st_mtimensec;
+#endif
return 0;
}
[-- Attachment #3: config.log --]
[-- Type: text/x-log, Size: 27183 bytes --]
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by git configure 1.6.4.2, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ ./configure --disable-pthreads --prefix=/usr --without-tcltk
## --------- ##
## Platform. ##
## --------- ##
hostname = (none)
uname -m = armv6l
uname -r = 2.6.30.4
uname -s = Linux
uname -v = #1 Fri Sep 4 23:05:31 CEST 2009
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1919: Setting lib to 'lib' (the default)
configure:1935: POSIX Threads will be disabled.
configure:1950: CHECKS for site configuration
configure:2187: CHECKS for programs
configure:2244: checking for cc
configure:2260: found /usr/bin/cc
configure:2271: result: cc
configure:2305: checking for C compiler version
configure:2313: cc --version >&5
uClibc rawgcc (GCC) 4.2.1
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2317: $? = 0
configure:2324: cc -v >&5
Invoked as cc
Reference path: /usr/bin/..
arg[ 0] = rawgcc
arg[ 1] = -U__nptl__
arg[ 2] = -v
Using built-in specs.
Target: armv6l-unknown-linux-gnueabi
Configured with: /home/tito/Desktop/firmware-0.9.7/build/temp-armv6l/gcc-core/configure --prefix=/home/tito/Desktop/firmware-0.9.7/build/root-filesystem-armv6l/usr --disable-multilib --build=i686-walrus-linux --host=armv6l-unknown-linux-gnueabi --target=armv6l-unknown-linux-gnueabi --enable-long-long --enable-c99 --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-nls --enable-languages=c,c++ --disable-libstdcxx-pch --program-prefix= --with-march=armv6 --with-mfloat-abi=soft --with-mfp=vfp --disable-sjlj-exceptions
Thread model: posix
gcc version 4.2.1
configure:2328: $? = 0
configure:2335: cc -V >&5
rawgcc: '-V' must come at the start of the command line
configure:2339: $? = 1
configure:2362: checking for C compiler default output file name
configure:2384: cc conftest.c >&5
configure:2388: $? = 0
configure:2426: result: a.out
configure:2445: checking whether the C compiler works
configure:2455: ./a.out
configure:2459: $? = 0
configure:2478: result: yes
configure:2485: checking whether we are cross compiling
configure:2487: result: no
configure:2490: checking for suffix of executables
configure:2497: cc -o conftest conftest.c >&5
configure:2501: $? = 0
configure:2527: result:
configure:2533: checking for suffix of object files
configure:2559: cc -c conftest.c >&5
configure:2563: $? = 0
configure:2588: result: o
configure:2592: checking whether we are using the GNU C compiler
configure:2621: cc -c conftest.c >&5
configure:2628: $? = 0
configure:2645: result: yes
configure:2654: checking whether cc accepts -g
configure:2684: cc -c -g conftest.c >&5
configure:2691: $? = 0
configure:2792: result: yes
configure:2809: checking for cc option to accept ISO C89
configure:2883: cc -c -g -O2 conftest.c >&5
configure:2890: $? = 0
configure:2913: result: none needed
configure:2933: checking if linker supports -R
configure:2962: cc -o conftest -g -O2 -R / conftest.c >&5
rawgcc: unrecognized option '-R'
/: file not recognized: Is a directory
collect2: ld returned 1 exit status
configure:2969: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2991: result: no
configure:2997: checking if linker supports -Wl,-rpath,
configure:3026: cc -o conftest -g -O2 -Wl,-rpath,/ conftest.c >&5
configure:3033: $? = 0
configure:3055: result: yes
configure:3180: checking for gar
configure:3210: result: no
configure:3180: checking for ar
configure:3196: found /usr/bin/ar
configure:3207: result: ar
configure:3235: checking for gtar
configure:3265: result: no
configure:3235: checking for tar
configure:3251: found /usr/bin/tar
configure:3262: result: tar
configure:3335: checking for asciidoc
configure:3365: result: no
configure:3399: CHECKS for libraries
configure:3414: checking for SHA1_Init in -lcrypto
configure:3449: cc -o conftest -g -O2 conftest.c -lcrypto >&5
/usr/bin/../libexec/gcc/armv6l-unknown-linux-gnueabi/4.2.1/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
configure:3456: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char SHA1_Init ();
| int
| main ()
| {
| return SHA1_Init ();
| ;
| return 0;
| }
configure:3477: result: no
configure:3482: checking for SHA1_Init in -lssl
configure:3517: cc -o conftest -g -O2 conftest.c -lssl >&5
/usr/bin/../libexec/gcc/armv6l-unknown-linux-gnueabi/4.2.1/ld: cannot find -lssl
collect2: ld returned 1 exit status
configure:3524: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char SHA1_Init ();
| int
| main ()
| {
| return SHA1_Init ();
| ;
| return 0;
| }
configure:3545: result: no
configure:3580: checking for curl_global_init in -lcurl
configure:3615: cc -o conftest -g -O2 conftest.c -lcurl >&5
/usr/bin/../libexec/gcc/armv6l-unknown-linux-gnueabi/4.2.1/ld: cannot find -lcurl
collect2: ld returned 1 exit status
configure:3622: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char curl_global_init ();
| int
| main ()
| {
| return curl_global_init ();
| ;
| return 0;
| }
configure:3643: result: no
configure:3674: checking for XML_ParserCreate in -lexpat
configure:3709: cc -o conftest -g -O2 conftest.c -lexpat >&5
/usr/bin/../libexec/gcc/armv6l-unknown-linux-gnueabi/4.2.1/ld: cannot find -lexpat
collect2: ld returned 1 exit status
configure:3716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char XML_ParserCreate ();
| int
| main ()
| {
| return XML_ParserCreate ();
| ;
| return 0;
| }
configure:3737: result: no
configure:3790: checking for iconv in -lc
configure:3809: cc -o conftest -g -O2 conftest.c -lc >&5
conftest.c:2:19: error: iconv.h: No such file or directory
configure:3816: $? = 1
configure: failed program was:
|
| #include <iconv.h>
|
| int main(void)
| {
| iconv_open("", "");
| return 0;
| }
|
configure:3832: result: no
configure:3790: checking for iconv in -liconv
configure:3809: cc -o conftest -g -O2 conftest.c -liconv >&5
conftest.c:2:19: error: iconv.h: No such file or directory
configure:3816: $? = 1
configure: failed program was:
|
| #include <iconv.h>
|
| int main(void)
| {
| iconv_open("", "");
| return 0;
| }
|
configure:3832: result: no
configure:3874: checking for deflateBound in -lz
configure:3895: cc -o conftest -g -O2 conftest.c -lz >&5
configure:3902: $? = 0
configure:3910: result: yes
configure:3938: checking for socket in -lc
configure:3973: cc -o conftest -g -O2 conftest.c -lc >&5
configure:3980: $? = 0
configure:4001: result: yes
configure:4016: checking for hstrerror in -lc
configure:4051: cc -o conftest -g -O2 conftest.c -lc >&5
configure:4058: $? = 0
configure:4079: result: yes
configure:4090: checking for basename in -lc
configure:4125: cc -o conftest -g -O2 conftest.c -lc >&5
configure:4132: $? = 0
configure:4153: result: yes
configure:4165: CHECKS for header files
configure:4174: checking how to run the C preprocessor
configure:4214: cc -E conftest.c
configure:4221: $? = 0
configure:4252: cc -E conftest.c
conftest.c:8:28: error: ac_nonexistent.h: No such file or directory
configure:4259: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:4292: result: cc -E
configure:4321: cc -E conftest.c
configure:4328: $? = 0
configure:4359: cc -E conftest.c
conftest.c:8:28: error: ac_nonexistent.h: No such file or directory
configure:4366: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:4406: checking for grep that handles long lines and -e
configure:4466: result: /usr/bin/grep
configure:4471: checking for egrep
configure:4535: result: /usr/bin/grep -E
configure:4540: checking for ANSI C header files
configure:4570: cc -c -g -O2 conftest.c >&5
configure:4577: $? = 0
configure:4673: cc -o conftest -g -O2 conftest.c >&5
configure:4677: $? = 0
configure:4683: ./conftest
configure:4687: $? = 0
configure:4705: result: yes
configure:4729: checking for sys/types.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for sys/stat.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for stdlib.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for string.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for memory.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for strings.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for inttypes.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for stdint.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4729: checking for unistd.h
configure:4750: cc -c -g -O2 conftest.c >&5
configure:4757: $? = 0
configure:4774: result: yes
configure:4798: checking sys/select.h usability
configure:4815: cc -c -g -O2 conftest.c >&5
configure:4822: $? = 0
configure:4836: result: yes
configure:4840: checking sys/select.h presence
configure:4855: cc -E conftest.c
configure:4862: $? = 0
configure:4876: result: yes
configure:4909: checking for sys/select.h
configure:4916: result: yes
configure:4942: checking for old iconv()
configure:4964: cc -c -g -O2 conftest.c >&5
conftest.c:2:19: error: iconv.h: No such file or directory
conftest.c:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'iconv'
configure:4971: $? = 1
configure: failed program was:
|
| #include <iconv.h>
|
| extern size_t iconv(iconv_t cd,
| char **inbuf, size_t *inbytesleft,
| char **outbuf, size_t *outbytesleft);
|
| int main(void)
| {
| return 0;
| }
|
configure:4982: result: yes
configure:4999: CHECKS for typedefs, structures, and compiler characteristics
configure:5003: checking for struct dirent.d_ino
configure:5032: cc -c -g -O2 conftest.c >&5
configure:5039: $? = 0
configure:5098: result: yes
configure:5110: checking for struct dirent.d_type
configure:5139: cc -c -g -O2 conftest.c >&5
configure:5146: $? = 0
configure:5205: result: yes
configure:5217: checking for struct sockaddr_storage
configure:5249: cc -c -g -O2 conftest.c >&5
configure:5256: $? = 0
configure:5287: cc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:26: error: expected expression before ')' token
configure:5294: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| #include <sys/types.h>
| #include <sys/socket.h>
|
|
| int
| main ()
| {
| if (sizeof ((struct sockaddr_storage)))
| return 0;
| ;
| return 0;
| }
configure:5317: result: yes
configure:5328: checking for struct addrinfo
configure:5361: cc -c -g -O2 conftest.c >&5
configure:5368: $? = 0
configure:5400: cc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:27: error: expected expression before ')' token
configure:5407: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| #include <sys/types.h>
| #include <sys/socket.h>
| #include <netdb.h>
|
|
| int
| main ()
| {
| if (sizeof ((struct addrinfo)))
| return 0;
| ;
| return 0;
| }
configure:5430: result: yes
configure:5434: checking for getaddrinfo
configure:5490: cc -o conftest -g -O2 conftest.c >&5
configure:5497: $? = 0
configure:5517: result: yes
configure:5521: checking for library containing getaddrinfo
configure:5562: cc -o conftest -g -O2 conftest.c >&5
configure:5569: $? = 0
configure:5600: result: none required
configure:5626: checking whether formatted IO functions support C99 size specifiers
configure:5666: cc -o conftest -g -O2 conftest.c >&5
configure:5670: $? = 0
configure:5676: ./conftest
configure:5680: $? = 0
configure:5698: result: yes
configure:5709: checking whether system succeeds to read fopen'ed directory
configure:5747: cc -o conftest -g -O2 conftest.c >&5
configure:5751: $? = 0
configure:5757: ./conftest
configure:5761: $? = 0
configure:5779: result: no
configure:5791: checking whether snprintf() and/or vsnprintf() return bogus value
configure:5842: cc -o conftest -g -O2 conftest.c >&5
configure:5846: $? = 0
configure:5852: ./conftest
configure:5856: $? = 0
configure:5874: result: no
configure:5886: CHECKS for library functions
configure:5900: checking libgen.h usability
configure:5917: cc -c -g -O2 conftest.c >&5
configure:5924: $? = 0
configure:5938: result: yes
configure:5942: checking libgen.h presence
configure:5957: cc -E conftest.c
configure:5964: $? = 0
configure:5978: result: yes
configure:6011: checking for libgen.h
configure:6018: result: yes
configure:6032: checking for strcasestr
configure:6088: cc -o conftest -g -O2 conftest.c >&5
configure:6095: $? = 0
configure:6115: result: yes
configure:6119: checking for library containing strcasestr
configure:6160: cc -o conftest -g -O2 conftest.c >&5
configure:6167: $? = 0
configure:6198: result: none required
configure:6216: checking for memmem
configure:6272: cc -o conftest -g -O2 conftest.c >&5
configure:6279: $? = 0
configure:6299: result: yes
configure:6303: checking for library containing memmem
configure:6344: cc -o conftest -g -O2 conftest.c >&5
configure:6351: $? = 0
configure:6382: result: none required
configure:6400: checking for strlcpy
configure:6456: cc -o conftest -g -O2 conftest.c >&5
configure:6463: $? = 0
configure:6483: result: yes
configure:6487: checking for library containing strlcpy
configure:6528: cc -o conftest -g -O2 conftest.c >&5
configure:6535: $? = 0
configure:6566: result: none required
configure:6584: checking for uintmax_t
configure:6615: cc -c -g -O2 conftest.c >&5
configure:6622: $? = 0
configure:6652: cc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:25: error: expected expression before ')' token
configure:6659: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| #include <inttypes.h>
|
|
| int
| main ()
| {
| if (sizeof ((uintmax_t)))
| return 0;
| ;
| return 0;
| }
configure:6682: result: yes
configure:6693: checking for strtoumax
configure:6749: cc -o conftest -g -O2 conftest.c >&5
configure:6756: $? = 0
configure:6776: result: yes
configure:6780: checking for library containing strtoumax
configure:6821: cc -o conftest -g -O2 conftest.c >&5
configure:6828: $? = 0
configure:6859: result: none required
configure:6877: checking for setenv
configure:6933: cc -o conftest -g -O2 conftest.c >&5
configure:6940: $? = 0
configure:6960: result: yes
configure:6964: checking for library containing setenv
configure:7005: cc -o conftest -g -O2 conftest.c >&5
configure:7012: $? = 0
configure:7043: result: none required
configure:7061: checking for unsetenv
configure:7117: cc -o conftest -g -O2 conftest.c >&5
configure:7124: $? = 0
configure:7144: result: yes
configure:7148: checking for library containing unsetenv
configure:7189: cc -o conftest -g -O2 conftest.c >&5
configure:7196: $? = 0
configure:7227: result: none required
configure:7245: checking for mkdtemp
configure:7301: cc -o conftest -g -O2 conftest.c >&5
configure:7308: $? = 0
configure:7328: result: yes
configure:7332: checking for library containing mkdtemp
configure:7373: cc -o conftest -g -O2 conftest.c >&5
configure:7380: $? = 0
configure:7411: result: none required
configure:7429: checking for mkstemps
configure:7485: cc -o conftest -g -O2 conftest.c >&5
/tmp/ccaFxzaQ.o: In function `main':
/home/git-1.6.4.2/conftest.c:52: undefined reference to `mkstemps'
collect2: ld returned 1 exit status
configure:7492: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "git"
| #define PACKAGE_TARNAME "git"
| #define PACKAGE_VERSION "1.6.4.2"
| #define PACKAGE_STRING "git 1.6.4.2"
| #define PACKAGE_BUGREPORT "git@vger.kernel.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| /* Define mkstemps to an innocuous variant, in case <limits.h> declares mkstemps.
| For example, HP-UX 11i <limits.h> declares gettimeofday. */
| #define mkstemps innocuous_mkstemps
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char mkstemps (); below.
| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
| <limits.h> exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|
| #undef mkstemps
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char mkstemps ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined __stub_mkstemps || defined __stub___mkstemps
| choke me
| #endif
|
| int
| main ()
| {
| return mkstemps ();
| ;
| return 0;
| }
configure:7512: result: no
configure:7637: Skipping POSIX Threads at user request.
configure:7904: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by git config.status 1.6.4.2, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on (none)
config.status:684: creating config.mak.autogen
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_c99_format=yes
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_fread_reads_directories=no
ac_cv_func_getaddrinfo=yes
ac_cv_func_memmem=yes
ac_cv_func_mkdtemp=yes
ac_cv_func_mkstemps=no
ac_cv_func_setenv=yes
ac_cv_func_strcasestr=yes
ac_cv_func_strlcpy=yes
ac_cv_func_strtoumax=yes
ac_cv_func_unsetenv=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_libgen_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_select_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_lib_c_basename=yes
ac_cv_lib_c_hstrerror=yes
ac_cv_lib_c_socket=yes
ac_cv_lib_crypto_SHA1_Init=no
ac_cv_lib_curl_curl_global_init=no
ac_cv_lib_expat_XML_ParserCreate=no
ac_cv_lib_ssl_SHA1_Init=no
ac_cv_member_struct_dirent_d_ino=yes
ac_cv_member_struct_dirent_d_type=yes
ac_cv_objext=o
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_prog_CPP='cc -E'
ac_cv_prog_TAR=tar
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_CC=cc
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_search_getaddrinfo='none required'
ac_cv_search_memmem='none required'
ac_cv_search_mkdtemp='none required'
ac_cv_search_setenv='none required'
ac_cv_search_strcasestr='none required'
ac_cv_search_strlcpy='none required'
ac_cv_search_strtoumax='none required'
ac_cv_search_unsetenv='none required'
ac_cv_snprintf_returns_bogus=no
ac_cv_type_struct_addrinfo=yes
ac_cv_type_struct_sockaddr_storage=yes
ac_cv_type_uintmax_t=yes
git_cv_ld_dashr=no
git_cv_ld_wl_rpath=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
AR='ar'
ASCIIDOC8=''
ASCIIDOC=''
CC='cc'
CC_LD_DYNPATH='-Wl,-rpath,'
CFLAGS=''
CPP='cc -E'
CPPFLAGS=''
DEFS='-DPACKAGE_NAME=\"git\" -DPACKAGE_TARNAME=\"git\" -DPACKAGE_VERSION=\"1.6.4.2\" -DPACKAGE_STRING=\"git\ 1.6.4.2\" -DPACKAGE_BUGREPORT=\"git@vger.kernel.org\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
FREAD_READS_DIRECTORIES=''
GREP='/usr/bin/grep'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
NEEDS_LIBGEN=''
NEEDS_LIBICONV=''
NEEDS_RESOLV=''
NEEDS_SOCKET=''
NEEDS_SSL_WITH_CRYPTO=''
NO_C99_FORMAT=''
NO_CURL='YesPlease'
NO_DEFLATE_BOUND=''
NO_D_INO_IN_DIRENT=''
NO_D_TYPE_IN_DIRENT=''
NO_EXPAT='YesPlease'
NO_ICONV='YesPlease'
NO_IPV6=''
NO_LIBGEN_H=''
NO_MEMMEM=''
NO_MKDTEMP=''
NO_MKSTEMPS='YesPlease'
NO_OPENSSL='YesPlease'
NO_PTHREADS='UnfortunatelyYes'
NO_SETENV=''
NO_SOCKADDR_STORAGE=''
NO_STRCASESTR=''
NO_STRLCPY=''
NO_STRTOUMAX=''
NO_SYS_SELECT_H=''
NO_UINTMAX_T=''
NO_UNSETENV=''
OBJEXT='o'
OLD_ICONV='UnfortunatelyYes'
PACKAGE_BUGREPORT='git@vger.kernel.org'
PACKAGE_NAME='git'
PACKAGE_STRING='git 1.6.4.2'
PACKAGE_TARNAME='git'
PACKAGE_VERSION='1.6.4.2'
PATH_SEPARATOR=':'
PTHREAD_LIBS=''
SHELL='/bin/sh'
SNPRINTF_RETURNS_BOGUS=''
TAR='tar'
TCLTK_PATH=''
THREADED_DELTA_SEARCH=''
ac_ct_AR='ar'
ac_ct_CC='cc'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE_NAME "git"
#define PACKAGE_TARNAME "git"
#define PACKAGE_VERSION "1.6.4.2"
#define PACKAGE_STRING "git 1.6.4.2"
#define PACKAGE_BUGREPORT "git@vger.kernel.org"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
configure: exit 0
^ permalink raw reply
* Re: [DIFF] build git on armv6l emulator with uclibc
From: Clemens Buchacher @ 2009-09-12 20:42 UTC (permalink / raw)
To: Tito; +Cc: git
In-Reply-To: <200909122218.07830.farmatito@tiscali.it>
On Sat, Sep 12, 2009 at 10:18:07PM +0200, Tito wrote:
> +#if 0
> mtime.nsec = ST_MTIME_NSEC(st);
> +#else
> + mtime.nsec = (unsigned long int)st.st_mtimensec;
> +#endif
You can do this instead:
$ echo NO_NSEC=YesPlease >> config.mak
$ make
Clemens
^ permalink raw reply
* Re: git push --confirm ?
From: Jeff King @ 2009-09-12 20:49 UTC (permalink / raw)
To: Owen Taylor; +Cc: Daniel Barkalow, git, Colin Walters
In-Reply-To: <1252786266.2974.61.camel@localhost.localdomain>
[cc'd Daniel; I think this proposal for a "confirm push" might interact
with your foreign VCS work a bit. I'm not sure anymore what would be the
right level for inserting this code.]
On Sat, Sep 12, 2009 at 04:11:06PM -0400, Owen Taylor wrote:
> The main UI advantage is that you can adjust the default with 'git
> config' it on and leave it on. The time you screw up is not when you are
> worried that you are going to push the wrong thing. It's when you are
> you know exactly what 'git push' is going to do and it does something
> different.
That makes sense. I would not want to use such a feature, but I see the
use case you are talking about (see, I told you I was bad person to
comment. ;) ).
It should be pretty straightforward to implement for the git protocol.
Pushing goes something like:
1. Get the list of refs from the remote.
2. Using the desired refspecs (either configured or from the command
line), make a list of src/dst pairs of refs to be pushed.
3. For each ref pair, send the "<old> <new> <name>" triple to the
remote (or not, if it is already up-to-date, a non-fast-forward,
etc).
4. Send the packed objects.
5. For each ref pair, print the status in a summary table.
So you would just want a "2.5" where you show something similar to the
summary table and get some confirmation (or abort). An iterative "do you
want to push this ref" strategy would be similar; just mark the refs you
do and don't want to push.
The tricky thing will be handling different transports. Some of that
code has been factored out, but I haven't looked at the details. On top
of that, I think Daniel is working in this area for his support
of foreign VCS helpers (and other transports like libcurl are getting
pushed out into their own helpers). So he may have a better idea of how
to go about this sanely.
> haven't finished testing. For updates, showing a commit count and (a
> probably limited number of) commit subjects would avoid having to
> cut-and-paste the update summary into git log.
>
> As you say, maybe that's something that just needs to be fixed
> with a better format for --dry-run. But that doesn't negate the main UI
> advantage.
Sure. I just think the two concepts are somewhat orthogonal (though you
would probably want to enable them together for your particular
workflow). It sounds like you want something like (and obviously you
could have a config option to avoid typing --log-changes each time):
$ git push --dry-run --log-changes
To server:/path/to/repo.git
5ad9dce..cfc497a topic -> topic
abcd123: commit subject 1
cfc497a: commit subject 2
That can potentially get long, though. I'm not sure if you would want to
abbreviate it in some way, and if so, how.
> Hmm, yeah, I've certainly looked at git-receive-pack(1) before but
> hadn't internalized that --force was client side. Certainly doing it
> with a single atomic pass is the better way to do it.
There is actually a server-side analogue, which is the
"receive.denyNonFastForwards" config option, and it defaults to "off".
The "--force" option is a client side way of helping you be polite. The
receive config option is about actual policy.
> (Wouldn't work for rsync and http pushes, right? A simple "Not
> supported" perhaps.)
Rsync, at least, is already non-atomic because there is no way to do
locking. So you wouldn't make anything worse by supporting this feature
(though you do widen the gap for the race condition by waiting for user
input). I'm not sure anyone really cares about rsync these days, though.
I believe http-push actually does some kind of DAV locking. So there's
no reason you this couldn't work for http push.
> Hmm, of two minds about this. Doing it as a pick-and-choose
> --interactive does integrate it conceptually with other parts of Git.
> And probably is occasionally useful.
>
> But it makes it considerably less convenient to just config on.
> Because any time you want to push more than 2-3 refs at once you'll have
> to add --no-interactive.
>
> It also increases the amount of reading - if I see all the branches at
> once that are being pushed I can immediately notice that I'm pushing two
> branches when I thought I was pushing one, without actually having to
> read the branch names.
I think it really depends on your workflow, and how many refs you are
typically pushing. So yeah, I can see that the iterative asking is not
really a replacement for what you are asking for.
-Peff
^ permalink raw reply
* Re: [DIFF] build git on armv6l emulator with uclibc
From: Tito @ 2009-09-12 20:52 UTC (permalink / raw)
To: git
In-Reply-To: <20090912204230.GA31317@localhost>
On Saturday 12 September 2009 22:42:30 Clemens Buchacher wrote:
> On Sat, Sep 12, 2009 at 10:18:07PM +0200, Tito wrote:
>
> > +#if 0
> > mtime.nsec = ST_MTIME_NSEC(st);
> > +#else
> > + mtime.nsec = (unsigned long int)st.st_mtimensec;
> > +#endif
>
> You can do this instead:
>
> $ echo NO_NSEC=YesPlease >> config.mak
> $ make
>
> Clemens
>
Maybe something about this could be added to configure
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-pthreads=FLAGS FLAGS is the value to pass to the compiler to enable
--disable-nsec
to avoid to someone else to reinvent the wheel like i did :-)
Ciao,
Tito
^ permalink raw reply
* Re: Confusing git pull error message
From: Jeff King @ 2009-09-12 21:11 UTC (permalink / raw)
To: John Tapsell; +Cc: Junio C Hamano, Git List
In-Reply-To: <43d8ce650909121301i4450489dhf475ff6894394a5f@mail.gmail.com>
On Sat, Sep 12, 2009 at 11:01:45PM +0300, John Tapsell wrote:
> So anyway, I tried to do a "git pull" and it gives me the misleading error:
>
> You asked me to pull without telling me which branch you
> want to merge with, and 'branch.master.merge' in
> your configuration file does not tell me either. Please
> name which branch you want to merge on the command line and
> try again (e.g. 'git pull <repository> <refspec>').
> See git-pull(1) for details on the refspec.
>
> [...]
>
> But the actual problem is that "master" doesn't exist on origin. So
> basically I _have_ told it what branch.master.remote and
> branch.master.merge etc is, it's just that they don't appear to exist.
Ugh. That is horrible. It's an artifact of the (IMHO) brain-dead way
that pull and fetch interact.
Pull doesn't actually look at the configuration at all. It just calls
fetch, and then fetch writes out a file containing the refs it pulled,
some of which may be marked with a magic "not-for-merge" flag. So we see
that nothing is available for merging and guess that it must not have
been configured. Which is of course wrong in your case; it just didn't
exist.
I think it is enough for git-pull to just check whether the config
exists, and if so, guess that the ref was simply not fetched. IOW,
this:
-- >8 --
Subject: [PATCH] pull: make "nothing to merge" error message more accurate
When pull sees that no branches are available for merge and
that we have a current branch, it assumes the problem is
that we had no branch.*.merge configuration. But it may also
be the case that we simply didn't pull the configured ref
(probably because it doesn't exist). Let's distinguish those
two cases.
Signed-off-by: Jeff King <peff@peff.net>
---
git-pull.sh | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index 0bbd5bf..4ddd537 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -89,6 +89,9 @@ error_on_no_merge_candidates () {
done
curr_branch=${curr_branch#refs/heads/}
+ upstream=`git config "branch.$curr_branch.merge" ||
+ git config "branch.$curr_branch.rebase"`
+ upstream_short=`echo "$upstream" | sed "s|refs/heads/||"`
if [ -z "$curr_branch" ]; then
echo "You are not currently on a branch, so I cannot use any"
@@ -96,7 +99,7 @@ error_on_no_merge_candidates () {
echo "Please specify which branch you want to merge on the command"
echo "line and try again (e.g. 'git pull <repository> <refspec>')."
echo "See git-pull(1) for details."
- else
+ elif [ -z "$upstream" ]; then
echo "You asked me to pull without telling me which branch you"
echo "want to merge with, and 'branch.${curr_branch}.merge' in"
echo "your configuration file does not tell me either. Please"
@@ -114,6 +117,10 @@ error_on_no_merge_candidates () {
echo " remote.<nickname>.fetch = <refspec>"
echo
echo "See git-config(1) for details."
+ else
+ echo "Your configuration specified for us to pull the ref"
+ echo "'$upstream_short', but we were unable to fetch it from"
+ echo "the remote."
fi
exit 1
}
--
1.6.5.rc0.201.g76b4d.dirty
^ permalink raw reply related
* Re: Confusing git pull error message
From: John Tapsell @ 2009-09-12 21:31 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, Git List
In-Reply-To: <20090912211119.GA30966@coredump.intra.peff.net>
2009/9/13 Jeff King <peff@peff.net>:
> + else
> + echo "Your configuration specified for us to pull the ref"
> + echo "'$upstream_short', but we were unable to fetch it from"
> + echo "the remote."
Thanks!
But why was it 'unable' ? Are there cases other than it not existing?
Maybe something less cryptic:
"Attempted to pull from ref $upstream_short but this branch does not
exist on remote."
Or something?
John
^ permalink raw reply
* Re: Confusing git pull error message
From: Sverre Rabbelier @ 2009-09-12 21:37 UTC (permalink / raw)
To: Jeff King; +Cc: John Tapsell, Junio C Hamano, Git List
In-Reply-To: <20090912211119.GA30966@coredump.intra.peff.net>
Heya,
On Sat, Sep 12, 2009 at 23:11, Jeff King <peff@peff.net> wrote:
> if [ -z "$curr_branch" ]; then
> echo "You are not currently on a branch, so I cannot use any"
> @@ -96,7 +99,7 @@ error_on_no_merge_candidates () {
> echo "Please specify which branch you want to merge on the command"
> echo "line and try again (e.g. 'git pull <repository> <refspec>')."
> echo "See git-pull(1) for details."
> - else
> + elif [ -z "$upstream" ]; then
> echo "You asked me to pull without telling me which branch you"
> echo "want to merge with, and 'branch.${curr_branch}.merge' in"
> echo "your configuration file does not tell me either. Please"
> @@ -114,6 +117,10 @@ error_on_no_merge_candidates () {
> echo " remote.<nickname>.fetch = <refspec>"
> echo
> echo "See git-config(1) for details."
> + else
> + echo "Your configuration specified for us to pull the ref"
> + echo "'$upstream_short', but we were unable to fetch it from"
> + echo "the remote."
> fi
> exit 1
> }
Pretty bad case of multiple personality disorder here? At first
there's a "me", then again a "me", and then all of a sudden a "we"?
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: obnoxious CLI complaints
From: Dmitry Potapov @ 2009-09-12 21:44 UTC (permalink / raw)
To: John Tapsell; +Cc: Brendan Miller, Jakub Narebski, git
In-Reply-To: <43d8ce650909121132n76cda485ycd53a0497e397960@mail.gmail.com>
On Sat, Sep 12, 2009 at 09:32:09PM +0300, John Tapsell wrote:
> 2009/9/12 Dmitry Potapov <dpotapov@gmail.com>:
> > On Wed, Sep 09, 2009 at 05:09:31PM -0700, Brendan Miller wrote:
> >> On Wed, Sep 9, 2009 at 2:54 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> >> > Brendan Miller <catphive@catphive.net> writes:
> >> >>
> >> Is the goal of interface design to make
> >> it difficult so I need to learn a lot of things, or easy so I can
> >> remain blissfully ignorant but still do what I want?
> >
> > Neither. You cannot get what unless you have specified what you want,
> > and for that you have to learn how to say that. Having good defaults is
> > very important, but the problem with choosing them is that people have
> > different preferences about them. For instance, you wanted the default
> > prefix for git-archive to be $myproject. For me, a good default would be
> > either $tag_name, or $myproject-$tag_name, or empty (as it is now!). So,
> > what you propose is *never* a good default for me. Moreover, changing
> > any default will cause a lot of pain for other people who use Git now.
> > Besides, writing something like --prefix='' is very ugly. So, the
> > current default makes perfect sense.
>
> Ah, great logic. You can't find a default that will suit everyone,
> therefore don't bother.
I did not say "don't bother". On contrary, I said that defaults are very
important, but, in this case, the current default makes far more sense
that what was proposed by Brendan.
>
> >> Yeah, I've been reading them. I'm saying that the docs are a crutch.
> >> RTFM is the problem not the solution. It makes the user do more work
> >> to avoid fixing usability issues.
> >
> > A usability issue exists when a person knows how to do that, but it is
> > inconvenient or error-prone; or when a learning curve is too steep.
> > But when someone cannot use, let's say, a compiler, because he or she
> > refuses to read to learn the language, it is not a usability issue.
>
> It's a usability issue when it doesn't just do the right thing in the
> majority of cases and lets you specify what you want it to do in the
> rest of the cases.
It does the right thing for me, and not just in most cases, it does so
in _all_ cases, because it does exactly it is told to do. And it is a
very important characteristics for any VCS, otherwise you can mess up
things easily. What is also good about Git is that it does not require
much keystrokes to do even rather complex stuff. And many defaults and
commands are configurable, so you can adjust it to your workflow. So,
I am not sure what your problem is.
Dmitry
^ permalink raw reply
* Re: git push --confirm ?
From: Daniel Barkalow @ 2009-09-12 21:55 UTC (permalink / raw)
To: Jeff King; +Cc: Owen Taylor, git, Colin Walters
In-Reply-To: <20090912204905.GA31427@coredump.intra.peff.net>
On Sat, 12 Sep 2009, Jeff King wrote:
> [cc'd Daniel; I think this proposal for a "confirm push" might interact
> with your foreign VCS work a bit. I'm not sure anymore what would be the
> right level for inserting this code.]
>
> On Sat, Sep 12, 2009 at 04:11:06PM -0400, Owen Taylor wrote:
>
> > The main UI advantage is that you can adjust the default with 'git
> > config' it on and leave it on. The time you screw up is not when you are
> > worried that you are going to push the wrong thing. It's when you are
> > you know exactly what 'git push' is going to do and it does something
> > different.
>
> That makes sense. I would not want to use such a feature, but I see the
> use case you are talking about (see, I told you I was bad person to
> comment. ;) ).
>
> It should be pretty straightforward to implement for the git protocol.
> Pushing goes something like:
>
> 1. Get the list of refs from the remote.
>
> 2. Using the desired refspecs (either configured or from the command
> line), make a list of src/dst pairs of refs to be pushed.
>
> 3. For each ref pair, send the "<old> <new> <name>" triple to the
> remote (or not, if it is already up-to-date, a non-fast-forward,
> etc).
>
> 4. Send the packed objects.
>
> 5. For each ref pair, print the status in a summary table.
>
> So you would just want a "2.5" where you show something similar to the
> summary table and get some confirmation (or abort). An iterative "do you
> want to push this ref" strategy would be similar; just mark the refs you
> do and don't want to push.
>
> The tricky thing will be handling different transports. Some of that
> code has been factored out, but I haven't looked at the details. On top
> of that, I think Daniel is working in this area for his support
> of foreign VCS helpers (and other transports like libcurl are getting
> pushed out into their own helpers). So he may have a better idea of how
> to go about this sanely.
The status used to be that each method of pushing implemented
approximately the rules you give, but implemented it separately. Now
there's a common implementation of those rules, with (1) being a method
call, (3&4) being a method, and the rest being in transport_push().
However, rsync and curl have not yet been converted to the new style. When
there is support for push with helpers, it will only use the new style
(because it would be pointlessly annoying to implement the git rules for
refspecs in the helpers).
So it should be easy to put something into transport_push to do a step 2.5
confirmation, and a bit more work (which ought to get done anyway) to make
it apply to rsync and http URLs.
(Furthermore, currently, http-push is a separate program from the fetch
code, which is moving from the main git executable to git-remote-curl; the
http push code should probably actually move to git-remote-curl, so that
there is a single external program taking care of all operations on such
URLs and there is less complexity in how the curl-using code is
structured.)
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Re: [PATCHv6 10/14] Teach notes code to free its internal data structures on request.
From: Johan Herland @ 2009-09-12 22:21 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Johannes.Schindelin, trast, tavestbo, git, chriscool,
spearce
In-Reply-To: <7vmy50f1mf.fsf@alter.siamese.dyndns.org>
On Saturday 12 September 2009, Junio C Hamano wrote:
> Johan Herland <johan@herland.net> writes:
> > There's no need to be rude to memory-concious callers...
>
> Will squash this in.
>
> -- >8 --
> From: Junio C Hamano <gitster@pobox.com>
> Date: Sat, 12 Sep 2009 11:34:24 -0700
> Subject: [PATCH] notes.[ch] fixup: avoid old-style declaration
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> notes.c | 2 +-
> notes.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/notes.c b/notes.c
> index 008c3d4..9ed2c87 100644
> --- a/notes.c
> +++ b/notes.c
> @@ -161,7 +161,7 @@ void get_commit_notes(const struct commit *commit,
> struct strbuf *sb, free(msg);
> }
>
> -void free_commit_notes()
> +void free_commit_notes(void)
> {
> free(hash_map.entries);
> memset(&hash_map, 0, sizeof(struct hash_map));
> diff --git a/notes.h b/notes.h
> index 41802e5..d1dd1d1 100644
> --- a/notes.h
> +++ b/notes.h
> @@ -7,6 +7,6 @@
> void get_commit_notes(const struct commit *commit, struct strbuf *sb,
> const char *output_encoding, int flags);
>
> -void free_commit_notes();
> +void free_commit_notes(void);
>
> #endif
Thanks,
Acked-by: Johan Herland <johan@herland.net>
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply
* Re: obnoxious CLI complaints
From: John Tapsell @ 2009-09-12 22:21 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: Brendan Miller, Jakub Narebski, git
In-Reply-To: <20090912214428.GB30385@dpotapov.dyndns.org>
2009/9/13 Dmitry Potapov <dpotapov@gmail.com>:
> On Sat, Sep 12, 2009 at 09:32:09PM +0300, John Tapsell wrote:
>> 2009/9/12 Dmitry Potapov <dpotapov@gmail.com>:
>> > On Wed, Sep 09, 2009 at 05:09:31PM -0700, Brendan Miller wrote:
>> >> On Wed, Sep 9, 2009 at 2:54 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> >> > Brendan Miller <catphive@catphive.net> writes:
>> >> >>
>> >> Is the goal of interface design to make
>> >> it difficult so I need to learn a lot of things, or easy so I can
>> >> remain blissfully ignorant but still do what I want?
>> >
>> > Neither. You cannot get what unless you have specified what you want,
>> > and for that you have to learn how to say that. Having good defaults is
>> > very important, but the problem with choosing them is that people have
>> > different preferences about them. For instance, you wanted the default
>> > prefix for git-archive to be $myproject. For me, a good default would be
>> > either $tag_name, or $myproject-$tag_name, or empty (as it is now!). So,
>> > what you propose is *never* a good default for me. Moreover, changing
>> > any default will cause a lot of pain for other people who use Git now.
>> > Besides, writing something like --prefix='' is very ugly. So, the
>> > current default makes perfect sense.
>>
>> Ah, great logic. You can't find a default that will suit everyone,
>> therefore don't bother.
>
> I did not say "don't bother". On contrary, I said that defaults are very
> important, but, in this case, the current default makes far more sense
> that what was proposed by Brendan.
>
>>
>> >> Yeah, I've been reading them. I'm saying that the docs are a crutch.
>> >> RTFM is the problem not the solution. It makes the user do more work
>> >> to avoid fixing usability issues.
>> >
>> > A usability issue exists when a person knows how to do that, but it is
>> > inconvenient or error-prone; or when a learning curve is too steep.
>> > But when someone cannot use, let's say, a compiler, because he or she
>> > refuses to read to learn the language, it is not a usability issue.
>>
>> It's a usability issue when it doesn't just do the right thing in the
>> majority of cases and lets you specify what you want it to do in the
>> rest of the cases.
>
> It does the right thing for me, and not just in most cases, it does so
> in _all_ cases, because it does exactly it is told to do. And it is a
> very important characteristics for any VCS, otherwise you can mess up
> things easily. What is also good about Git is that it does not require
> much keystrokes to do even rather complex stuff. And many defaults and
> commands are configurable, so you can adjust it to your workflow. So,
> I am not sure what your problem is.
Because I wouldn't call this just a few keystrokes to do the common case:
git archive --format=tar --prefix=HEAD/ HEAD | gzip > head.tar.gz
I honestly don't understand the backlash against Brenden's point that
this could be made a bit simpler.
John
^ permalink raw reply
* Re: Confusing git pull error message
From: Jeff King @ 2009-09-12 22:31 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: John Tapsell, Junio C Hamano, Git List
In-Reply-To: <fabb9a1e0909121437q4eb432e3idde98993ac552b5@mail.gmail.com>
On Sat, Sep 12, 2009 at 11:37:47PM +0200, Sverre Rabbelier wrote:
> > + echo "Your configuration specified for us to pull the ref"
> > + echo "'$upstream_short', but we were unable to fetch it from"
> > + echo "the remote."
> > fi
> > exit 1
> > }
>
> Pretty bad case of multiple personality disorder here? At first
> there's a "me", then again a "me", and then all of a sudden a "we"?
Fair enough. I'll change it to "I was unable to fetch" in the re-roll.
-Peff
^ permalink raw reply
* Re: Confusing git pull error message
From: Jeff King @ 2009-09-12 22:34 UTC (permalink / raw)
To: John Tapsell; +Cc: Junio C Hamano, Git List
In-Reply-To: <43d8ce650909121431o382b9348q19ee7db5adbb4a72@mail.gmail.com>
On Sun, Sep 13, 2009 at 12:31:46AM +0300, John Tapsell wrote:
> 2009/9/13 Jeff King <peff@peff.net>:
>
> > + else
> > + echo "Your configuration specified for us to pull the ref"
> > + echo "'$upstream_short', but we were unable to fetch it from"
> > + echo "the remote."
>
> Thanks!
>
> But why was it 'unable' ? Are there cases other than it not existing?
> Maybe something less cryptic:
>
> "Attempted to pull from ref $upstream_short but this branch does not
> exist on remote."
>
> Or something?
I'm not sure if there are other cases, so I left it unspecified. I think
that "does not exist" is probably the only one that should make it this
far, though, as any actual error would cause fetch to die, aborting the
pull.
And you can see that when you ask for a specific bogus ref, as in:
$ git pull origin bogus
fatal: Couldn't find remote ref bogus
I'll re-roll the patch with more specific wording.
-Peff
^ permalink raw reply
* Re: [PATCHv6 13/14] Allow flexible organization of notes trees, using both commit date and SHA1
From: Johan Herland @ 2009-09-12 22:33 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Johannes.Schindelin, trast, tavestbo, git, chriscool,
spearce
In-Reply-To: <7viqfof1kc.fsf@alter.siamese.dyndns.org>
On Saturday 12 September 2009, Junio C Hamano wrote:
> Johan Herland <johan@herland.net> writes:
> > This is a major expansion of the notes lookup code to allow for
> > variations in the notes tree organization. The variations allowed
> > include mixing fanout schemes based on the commit dates of the
> > annotated commits (aka. date-based fanout) with fanout schemes based on
> > the SHA1 of the annotated commits (aka. SHA1-based fanout).
Note that this patch is about to be removed from this series, cf. today's
discussion with Shawn elsewhere in this thread.
> Will squash this in.
I agree with the attempt, but not all of the hunks are good:
> @@ -281,20 +281,20 @@ static int note_tree_insert(struct int_node *tree,
> unsigned char n, /* Free the entire notes data contained in the given
> tree */
> static void note_tree_free(struct int_node *tree)
> {
> - if (tree->magic == (void *) ~0) {
> - if (tree->prev) {
> - note_tree_free(tree->prev);
> - free(tree->prev);
> + if (tree->u.s.magic == (void *) ~0) {
> + if (tree->u.s.prev) {
> + note_tree_free(tree->u.s.prev);
> + free(tree->u.s.prev);
> }
> - if (tree->child) {
> - note_tree_free(tree->child);
> - free(tree->child);
> + if (tree->u.s.magic) {
> + note_tree_free(tree->u.s.magic);
> + free(tree->u.s.magic);
Here, you are replacing tree->child with tree->u.s.magic. Shouldn't that be
tree->u.s.child instead?
> @@ -439,12 +439,12 @@ static void load_date_subtree(struct tree_desc
> *tree_desc, else /* this is the last entry, store directly into node */
> new_node = node;
>
> - new_node->magic = (void *) ~0;
> - new_node->child = NULL;
> - new_node->prev = cur_node;
> - new_node->parent = parent;
> - hashcpy(new_node->tree_sha1, entry.sha1);
> - strcpy(new_node->period, period);
> + new_node->u.s.magic = (void *) ~0;
> + new_node->u.s.magic = NULL;
Same as above: new_node->u.s.child
> + new_node->u.s.prev = cur_node;
> + new_node->u.s.parent = parent;
> + hashcpy(new_node->u.s.tree_sha1, entry.sha1);
> + strcpy(new_node->u.s.period, period);
> cur_node = new_node;
> }
> assert(!cur_node || cur_node == node);
> @@ -552,38 +552,38 @@ static unsigned char *lookup_notes(const struct
> commit *commit) /* Convert commit->date to YYYY-MM-DD format */
> short_date = show_date(commit->date, 0, DATE_SHORT);
>
> - while (node->magic == (void *) ~0) { /* date-based node */
> - int cmp = SUBTREE_DATE_PREFIXCMP(short_date, node->period);
> + while (node->u.s.magic == (void *) ~0) { /* date-based node */
> + int cmp = SUBTREE_DATE_PREFIXCMP(short_date, node->u.s.period);
> if (cmp == 0) {
> /* Search inside child node */
> - if (!node->child) {
> + if (!node->u.s.magic) {
> /* Must unpack child node first */
> - node->child = (struct int_node *)
> + node->u.s.magic = (struct int_node *)
> xcalloc(sizeof(struct int_node), 1);
> - load_subtree(node->tree_sha1,
> - (const unsigned char *) node->period,
> - strlen(node->period), node->child,
> + load_subtree(node->u.s.tree_sha1,
> + (const unsigned char *) node->u.s.period,
> + strlen(node->u.s.period), node->u.s.magic,
> node, -1);
> }
> seen_node = node;
> - node = node->child;
> + node = node->u.s.magic;
Same again, 4 times in the above hunk.
> @@ -591,15 +591,15 @@ static unsigned char *lookup_notes(const struct
> commit *commit) }
> }
> while (cur_node &&
> - SUBTREE_DATE_PREFIXCMP(cur_node->period, seen_node->period) < 0)
> + SUBTREE_DATE_PREFIXCMP(cur_node->u.s.period,
> seen_node->u.s.period) < 0) {
> /*
> * We're about to move cur_node backwards in history. We are
> * unlikely to need this cur_node in the future, so free() it.
> */
> - note_tree_free(cur_node->child);
> - cur_node->child = NULL;
> - cur_node = cur_node->parent;
> + note_tree_free(cur_node->u.s.magic);
> + cur_node->u.s.magic = NULL;
...and another one here.
> + cur_node = cur_node->u.s.parent;
> }
> cur_node = seen_node;
>
But as I said above, you may want to drop 13/14 and 14/14 completely,
instead.
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply
* Re: obnoxious CLI complaints
From: A Large Angry SCM @ 2009-09-12 22:35 UTC (permalink / raw)
To: John Tapsell; +Cc: Dmitry Potapov, Brendan Miller, Jakub Narebski, git
In-Reply-To: <43d8ce650909121521m3dbac12co7f5f2dcaf15190e7@mail.gmail.com>
John Tapsell wrote:
> 2009/9/13 Dmitry Potapov <dpotapov@gmail.com>:
>> On Sat, Sep 12, 2009 at 09:32:09PM +0300, John Tapsell wrote:
>>> 2009/9/12 Dmitry Potapov <dpotapov@gmail.com>:
>>>> On Wed, Sep 09, 2009 at 05:09:31PM -0700, Brendan Miller wrote:
>>>>> On Wed, Sep 9, 2009 at 2:54 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>>>>>> Brendan Miller <catphive@catphive.net> writes:
>>>>> Is the goal of interface design to make
>>>>> it difficult so I need to learn a lot of things, or easy so I can
>>>>> remain blissfully ignorant but still do what I want?
>>>> Neither. You cannot get what unless you have specified what you want,
>>>> and for that you have to learn how to say that. Having good defaults is
>>>> very important, but the problem with choosing them is that people have
>>>> different preferences about them. For instance, you wanted the default
>>>> prefix for git-archive to be $myproject. For me, a good default would be
>>>> either $tag_name, or $myproject-$tag_name, or empty (as it is now!). So,
>>>> what you propose is *never* a good default for me. Moreover, changing
>>>> any default will cause a lot of pain for other people who use Git now.
>>>> Besides, writing something like --prefix='' is very ugly. So, the
>>>> current default makes perfect sense.
>>> Ah, great logic. You can't find a default that will suit everyone,
>>> therefore don't bother.
>> I did not say "don't bother". On contrary, I said that defaults are very
>> important, but, in this case, the current default makes far more sense
>> that what was proposed by Brendan.
>>
>>>>> Yeah, I've been reading them. I'm saying that the docs are a crutch.
>>>>> RTFM is the problem not the solution. It makes the user do more work
>>>>> to avoid fixing usability issues.
>>>> A usability issue exists when a person knows how to do that, but it is
>>>> inconvenient or error-prone; or when a learning curve is too steep.
>>>> But when someone cannot use, let's say, a compiler, because he or she
>>>> refuses to read to learn the language, it is not a usability issue.
>>> It's a usability issue when it doesn't just do the right thing in the
>>> majority of cases and lets you specify what you want it to do in the
>>> rest of the cases.
>> It does the right thing for me, and not just in most cases, it does so
>> in _all_ cases, because it does exactly it is told to do. And it is a
>> very important characteristics for any VCS, otherwise you can mess up
>> things easily. What is also good about Git is that it does not require
>> much keystrokes to do even rather complex stuff. And many defaults and
>> commands are configurable, so you can adjust it to your workflow. So,
>> I am not sure what your problem is.
>
> Because I wouldn't call this just a few keystrokes to do the common case:
>
> git archive --format=tar --prefix=HEAD/ HEAD | gzip > head.tar.gz
>
> I honestly don't understand the backlash against Brenden's point that
> this could be made a bit simpler.
Be made simpler for whom? The first rule of defaults is that they are
never correct.
And, to every one, if you don;t think like the way <SOME_PROGRAM> has
it's defaults set and the developer(s) don't agree to change the default
for _everyone_ to what _you_ like, you can still use your shell's alias
facility to fix the situation for your own use case.
To channel Junio, why are we still having this discussion?
^ permalink raw reply
* Re: Confusing git pull error message
From: Sverre Rabbelier @ 2009-09-12 22:37 UTC (permalink / raw)
To: Jeff King; +Cc: John Tapsell, Junio C Hamano, Git List
In-Reply-To: <20090912223137.GA8748@coredump.intra.peff.net>
Heya,
On Sun, Sep 13, 2009 at 00:31, Jeff King <peff@peff.net> wrote:
> Fair enough. I'll change it to "I was unable to fetch" in the re-roll.
Actually, from grepping through the source there's a lot of we-ing
going on already (although mostly in the comments), and fairly little
I-ing (not based on actual numbers, just what I could judge at a
glance), so maybe changing the ones above to "we" instead is more
appropriate?
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: obnoxious CLI complaints
From: Dmitry Potapov @ 2009-09-12 22:43 UTC (permalink / raw)
To: John Tapsell; +Cc: Brendan Miller, Jakub Narebski, git
In-Reply-To: <43d8ce650909121521m3dbac12co7f5f2dcaf15190e7@mail.gmail.com>
On Sun, Sep 13, 2009 at 01:21:43AM +0300, John Tapsell wrote:
>
> Because I wouldn't call this just a few keystrokes to do the common case:
>
> git archive --format=tar --prefix=HEAD/ HEAD | gzip > head.tar.gz
>
> I honestly don't understand the backlash against Brenden's point that
> this could be made a bit simpler.
You do not have to specify '--format=tar', because it is default. The
prefix name is a matter of one's preferences. Brenden wanted it to be
$myproject, while I have used three different versions. Now, you suggest
some other. IMHO, having it empty by default makes much more sense when
there is no obvious value on what most would agree. Finally, 'HEAD' is
required, because we do not want 'git archive' being run without any
parameter to write a binary file to the terminal. (Yes, it is foolish to
run command that you do not know to see what it does, but some people do
that, and we want all commands to be safe). BTW, I wonder whether use of
HEAD is really common with git-archive. Normally, you would archive a
tagged release, and then it is better to use the tag name to be sure
that you have archived the right thing.
Dmitry
^ permalink raw reply
* [RFC/PATCH v4 1/2] gitweb: check given hash before trying to create snapshot
From: Mark Rada @ 2009-09-12 23:03 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Junio C Hamano
I changed some variable names to be nicer looking.
--
Mark Rada (ferrous26)
marada@uwaterloo.ca
--->8---
Makes things nicer in cases when you hand craft the snapshot URL but
make a typo in defining the hash variable (e.g. netx instead of next);
you will now get an error message instead of a broken tarball.
To maintain backwards compatibility, git_get_head_hash is now a wrapper
for git_get_full_hash, as suggested by Jakub Narebski.
Tests for t9501 are included to demonstrate added functionality.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
gitweb/gitweb.perl | 19 +++++++++++++------
t/t9501-gitweb-standalone-http-status.sh | 29 +++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 24b2193..e1beca5 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1983,14 +1983,20 @@ sub quote_command {
# get HEAD ref of given project as hash
sub git_get_head_hash {
+ return git_get_full_hash(shift, 'HEAD');
+}
+
+# given a project and tree-ish, returns full hash
+sub git_get_full_hash {
my $project = shift;
+ my $hash = shift;
my $o_git_dir = $git_dir;
my $retval = undef;
$git_dir = "$projectroot/$project";
- if (open my $fd, "-|", git_cmd(), "rev-parse", "--verify", "HEAD") {
- my $head = <$fd>;
+ if (open my $fd, '-|', git_cmd(), 'rev-parse', '--verify', $hash) {
+ $hash = <$fd>;
close $fd;
- if (defined $head && $head =~ /^([0-9a-fA-F]{40})$/) {
+ if (defined $hash && $hash =~ /^([0-9a-fA-F]{40})$/) {
$retval = $1;
}
}
@@ -5196,8 +5202,9 @@ sub git_snapshot {
die_error(403, "Unsupported snapshot format");
}
- if (!defined $hash) {
- $hash = git_get_head_hash($project);
+ my $full_hash = git_get_full_hash($project, $hash);
+ if (!$full_hash) {
+ die_error(404, 'Hash id was not valid');
}
my $name = $project;
@@ -5210,7 +5217,7 @@ sub git_snapshot {
$cmd = quote_command(
git_cmd(), 'archive',
"--format=$known_snapshot_formats{$format}{'format'}",
- "--prefix=$name/", $hash);
+ "--prefix=$name/", $full_hash);
if (exists $known_snapshot_formats{$format}{'compressor'}) {
$cmd .= ' | ' . quote_command(@{$known_snapshot_formats{$format}{'compressor'}});
}
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index d0ff21d..632007e 100644
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -75,4 +75,33 @@ test_expect_success \
test_debug 'cat gitweb.output'
+# ----------------------------------------------------------------------
+# snapshot hash ids
+
+test_expect_success \
+ 'snapshots: good treeish id' \
+ 'gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: bad treeish id' \
+ 'gitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&
+ grep "404 - Hash id was not valid" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: good object id' \
+ 'ID=`git rev-parse --verify HEAD` &&
+ gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: bad object id' \
+ 'gitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&
+ grep "404 - Hash id was not valid" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
test_done
--
1.6.4.2
^ permalink raw reply related
* [RFC/PATCH v4 2/2] gitweb: append short hash ids to snapshot files
From: Mark Rada @ 2009-09-12 23:04 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narebski
Teach gitweb how to produce nicer snapshot names by only using the
short hash id. If clients make requests using a tree-ish that is not a
partial or full SHA-1 hash, then the short hash will also be appended
to whatever they asked for.
This also includes tests cases for t9502-gitweb-standalone-parse-output.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
gitweb/gitweb.perl | 26 +++++++++++
t/t9502-gitweb-standalone-parse-output.sh | 67 +++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 0 deletions(-)
create mode 100644 t/t9502-gitweb-standalone-parse-output.sh
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e1beca5..fdecc3d 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2006,6 +2006,26 @@ sub git_get_full_hash {
return $retval;
}
+# try and get a shorter hash id
+sub git_get_short_hash {
+ my $project = shift;
+ my $hash = shift;
+ my $o_git_dir = $git_dir;
+ my $retval = undef;
+ $git_dir = "$projectroot/$project";
+ if (open my $fd, '-|', git_cmd(), 'rev-parse', '--short', $hash) {
+ $hash = <$fd>;
+ close $fd;
+ if (defined $hash && $hash =~ /^([0-9a-fA-F]{7,})$/) {
+ $retval = $1;
+ }
+ }
+ if (defined $o_git_dir) {
+ $git_dir = $o_git_dir;
+ }
+ return $retval;
+}
+
# get type of given object
sub git_get_type {
my $hash = shift;
@@ -5207,6 +5227,12 @@ sub git_snapshot {
die_error(404, 'Hash id was not valid');
}
+
+ if ($full_hash !~ /$hash/) {
+ $hash .= '-' . git_get_short_hash($project, $hash);
+ } else {
+ $hash = git_get_short_hash($project, $hash);
+ }
my $name = $project;
$name =~ s,([^/])/*\.git$,$1,;
$name = basename($name);
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
new file mode 100644
index 0000000..1a2a27f
--- /dev/null
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Mark Rada
+#
+
+test_description='gitweb as standalone script (parsing script output).
+
+This test runs gitweb (git web interface) as a CGI script from the
+commandline, and checks that it produces the correct output, either
+in the HTTP header or the actual script output.'
+
+
+. ./gitweb-lib.sh
+
+# ----------------------------------------------------------------------
+# snapshot file name
+
+test_commit \
+ 'SnapshotFileTests' \
+ 'i can has snapshot?'
+
+test_expect_success \
+ 'snapshots: give full hash' \
+ 'ID=`git rev-parse --verify HEAD` &&
+ gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
+ ID=`git rev-parse --short HEAD` &&
+ grep ".git-$ID.tar.gz" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: give short hash' \
+ 'ID=`git rev-parse --short HEAD` &&
+ gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
+ grep ".git-$ID.tar.gz" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: give almost full hash' \
+ 'ID=`git rev-parse --short=30 HEAD` &&
+ gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
+ ID=`git rev-parse --short HEAD` &&
+ grep ".git-$ID.tar.gz" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: give HEAD tree-ish' \
+ 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
+ ID=`git rev-parse --short HEAD` &&
+ grep ".git-HEAD-$ID.tar.gz" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: give branch name tree-ish' \
+ 'gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+ ID=`git rev-parse --short master` &&
+ grep ".git-master-$ID.tar.gz" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: give tag tree-ish' \
+ 'gitweb_run "p=.git;a=snapshot;h=SnapshotFileTests;sf=tgz" &&
+ ID=`git rev-parse --short SnapshotFileTests` &&
+ grep ".git-SnapshotFileTests-$ID.tar.gz" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
+test_done
--
1.6.4.2
^ permalink raw reply related
* Re: obnoxious CLI complaints
From: John Tapsell @ 2009-09-12 23:08 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: Brendan Miller, Jakub Narebski, git
In-Reply-To: <20090912224335.GC30385@dpotapov.dyndns.org>
2009/9/13 Dmitry Potapov <dpotapov@gmail.com>:
> On Sun, Sep 13, 2009 at 01:21:43AM +0300, John Tapsell wrote:
>>
>> Because I wouldn't call this just a few keystrokes to do the common case:
>>
>> git archive --format=tar --prefix=HEAD/ HEAD | gzip > head.tar.gz
>>
>> I honestly don't understand the backlash against Brenden's point that
>> this could be made a bit simpler.
>
> You do not have to specify '--format=tar', because it is default. The
> prefix name is a matter of one's preferences. Brenden wanted it to be
> $myproject, while I have used three different versions. Now, you suggest
> some other. IMHO, having it empty by default makes much more sense when
> there is no obvious value on what most would agree. Finally, 'HEAD' is
> required, because we do not want 'git archive' being run without any
> parameter to write a binary file to the terminal. (Yes, it is foolish to
> run command that you do not know to see what it does, but some people do
> that, and we want all commands to be safe). BTW, I wonder whether use of
> HEAD is really common with git-archive. Normally, you would archive a
> tagged release, and then it is better to use the tag name to be sure
> that you have archived the right thing.
Ah, the manpage examples specifically give the --format=tar though.
Why not have --format=tgz then or something? Or better yet, give
the filename on the command line and detect the format from the file
extension.
^ permalink raw reply
* Re: [PATCHv6 13/14] Allow flexible organization of notes trees, using both commit date and SHA1
From: Junio C Hamano @ 2009-09-12 23:37 UTC (permalink / raw)
To: Johan Herland
Cc: Junio C Hamano, git, Johannes.Schindelin, trast, tavestbo, git,
chriscool, spearce
In-Reply-To: <200909130033.28666.johan@herland.net>
Johan Herland <johan@herland.net> writes:
> But as I said above, you may want to drop 13/14 and 14/14 completely,
> instead.
Thanks. Will do.
^ permalink raw reply
* Re: [PATCH] use write_str_in_full helper to avoid literal string lengths
From: Junio C Hamano @ 2009-09-12 23:56 UTC (permalink / raw)
To: Jim Meyering; +Cc: git list
In-Reply-To: <87skes35mf.fsf@meyering.net>
Jim Meyering <jim@meyering.net> writes:
> ...Thus not requiring the added allocation, and still avoiding
> the maintenance risk of literal string lengths.
> These days, compilers are good enough that strlen("literal")
> imposes no run-time cost.
>
> Transformed via this:
>
> perl -pi -e \
> 's/write_in_full\((.*?), (".*?"), \d+\)/write_str_in_full($1, $2)/'\
> $(git grep -l 'write_in_full.*"')
>
>
> From fe368f8b3720f04c9dfce952711d2fb412b52e3c Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Sat, 12 Sep 2009 09:56:13 +0200
> Subject: [PATCH] use write_str_in_full helper to avoid literal string lengths
>
> * cache.h (write_str_in_full): Define function.
> * builtin-fetch.c (quickfetch): Use it.
> * builtin-reflog.c (expire_reflog): Likewise.
> * commit.c (write_shallow_commits): Likewise.
> * config.c (git_config_set_multivar): Likewise.
> * rerere.c (write_rr): Likewise.
> * transport-helper.c (get_helper, disconnect_helper): Likewise.
> (get_refs_list): Likewise.
> * upload-pack.c (receive_needs): Likewise.
Thanks. I agree with the reasoning you wrote outside the proposed log
message.
We usually do not write these bullet points (iow, we are not GNU) in our
log message. The names of the functions, call sites and files that are
involved are something anybody can see from the patch text,
I think the GNU convention was useful back when we were trapped in a
system with non-atomic commits, where it was very hard to see what files
were affected in a single logical changeset (i.e. CVS).
Luckily, we graduated those dark ages.
Instead, we prefer to have justifications (and methods), like what you
wrote at the beginning of your message. These are not something people
can find in the patch text and they deserve to be recorded in the commit.
^ permalink raw reply
* Re: Effectively tracing project contributions with git
From: Joseph Wakeling @ 2009-09-13 0:03 UTC (permalink / raw)
To: Jeff King; +Cc: Sverre Rabbelier, git
In-Reply-To: <20090912185940.GA21277@coredump.intra.peff.net>
Jeff King wrote:
> We can probably help you with the git side of things, but defining "who
> contributed what" is kind of a hairy problem. You will need to define
> exactly how you want to count contributions.
Yes, that's pretty much what I'm looking for. My thoughts on
contribution run along much the same lines as yours -- there's a need to
distinguish between meaningful additions and mere tweaks.
My general rule is that stuff like whitespace changes, changing the name
of variables, typo corrections etc. is not a meaningful contribution
although if someone had really done a lot of it I might see things
differently. Substantial additions -- extending the code, comments or
documentation -- are what I'm after. Ultimately this has to be decided
by me actually looking at things rather than metrics.
What I'm doing right now is to run a git shortlog on a file to get a
rough idea of the contributors and who are likely to be the main
authors, then using gitk to browse the commits for that file. It's
time-consuming but works -- once I've identified at least one major
commit from someone I can ignore everything else by them and concentrate
on the remaining contributors.
What would help is some way to speed up the process of getting someone's
commits: 'give me all the diffs for file X by author Y'. I'm not too
good at shell scripting so grep-y things don't spring easily to mind.
An alternative useful tool would be 'give me all the commits to this
file that change more than N lines'.
With those two -- particularly the first -- I think I'd be able to get a
fair way. It won't work for the files where there has been a lot of
moving of content or renames, but that's mostly in the docs -- the code,
which is the really important thing, doesn't seem so bad (so far).
Thanks very much for the advice and careful thoughts,
Best wishes,
-- Joe
^ permalink raw reply
* [PATCH] git-push: Accept -n as a synonym for --dry-run.
From: Nelson Elhage @ 2009-09-13 0:05 UTC (permalink / raw)
To: git; +Cc: Nelson Elhage
'-n' is the standard way to specify a dry run for other git commands,
so make 'git-push' accept it as well.
---
Documentation/git-push.txt | 3 ++-
builtin-push.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 58d2bd5..ba6a8a2 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -9,7 +9,7 @@ git-push - Update remote refs along with associated objects
SYNOPSIS
--------
[verse]
-'git push' [--all | --mirror | --tags] [--dry-run] [--receive-pack=<git-receive-pack>]
+'git push' [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
[--repo=<repository>] [-f | --force] [-v | --verbose]
[<repository> <refspec>...]
@@ -82,6 +82,7 @@ nor in any Push line of the corresponding remotes file---see below).
if the configuration option `remote.<remote>.mirror` is
set.
+-n::
--dry-run::
Do everything except actually send the updates.
diff --git a/builtin-push.c b/builtin-push.c
index 787011f..5e5f3ad 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -10,7 +10,7 @@
#include "parse-options.h"
static const char * const push_usage[] = {
- "git push [--all | --mirror] [--dry-run] [--porcelain] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
+ "git push [--all | --mirror] [-n | --dry-run] [--porcelain] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
NULL,
};
@@ -182,7 +182,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
OPT_BIT( 0 , "mirror", &flags, "mirror all refs",
(TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
OPT_BOOLEAN( 0 , "tags", &tags, "push tags"),
- OPT_BIT( 0 , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN),
+ OPT_BIT('n' , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN),
OPT_BIT( 0, "porcelain", &flags, "machine-readable output", TRANSPORT_PUSH_PORCELAIN),
OPT_BIT('f', "force", &flags, "force updates", TRANSPORT_PUSH_FORCE),
OPT_BOOLEAN( 0 , "thin", &thin, "use thin pack"),
--
1.6.3.1.499.ge7b8da
^ permalink raw reply related
* [RFC/PATCH v4 1/2] gitweb: check given hash before trying to create snapshot
From: Mark Rada @ 2009-09-13 0:09 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narebski
Makes things nicer in cases when you hand craft the snapshot URL but
make a typo in defining the hash variable (e.g. netx instead of next);
you will now get an error message instead of a broken tarball.
To maintain backwards compatibility, git_get_head_hash is now a wrapper
for git_get_full_hash, as suggested by Jakub Narebski.
Tests for t9501 are included to demonstrate added functionality.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
This is just a re-send based on getting torn a new one by Junio.
Changes since v3:
- variables have been renamed for readability
gitweb/gitweb.perl | 19 +++++++++++++------
t/t9501-gitweb-standalone-http-status.sh | 29 +++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 24b2193..e1beca5 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1983,14 +1983,20 @@ sub quote_command {
# get HEAD ref of given project as hash
sub git_get_head_hash {
+ return git_get_full_hash(shift, 'HEAD');
+}
+
+# given a project and tree-ish, returns full hash
+sub git_get_full_hash {
my $project = shift;
+ my $hash = shift;
my $o_git_dir = $git_dir;
my $retval = undef;
$git_dir = "$projectroot/$project";
- if (open my $fd, "-|", git_cmd(), "rev-parse", "--verify", "HEAD") {
- my $head = <$fd>;
+ if (open my $fd, '-|', git_cmd(), 'rev-parse', '--verify', $hash) {
+ $hash = <$fd>;
close $fd;
- if (defined $head && $head =~ /^([0-9a-fA-F]{40})$/) {
+ if (defined $hash && $hash =~ /^([0-9a-fA-F]{40})$/) {
$retval = $1;
}
}
@@ -5196,8 +5202,9 @@ sub git_snapshot {
die_error(403, "Unsupported snapshot format");
}
- if (!defined $hash) {
- $hash = git_get_head_hash($project);
+ my $full_hash = git_get_full_hash($project, $hash);
+ if (!$full_hash) {
+ die_error(404, 'Hash id was not valid');
}
my $name = $project;
@@ -5210,7 +5217,7 @@ sub git_snapshot {
$cmd = quote_command(
git_cmd(), 'archive',
"--format=$known_snapshot_formats{$format}{'format'}",
- "--prefix=$name/", $hash);
+ "--prefix=$name/", $full_hash);
if (exists $known_snapshot_formats{$format}{'compressor'}) {
$cmd .= ' | ' . quote_command(@{$known_snapshot_formats{$format}{'compressor'}});
}
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index d0ff21d..632007e 100644
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -75,4 +75,33 @@ test_expect_success \
test_debug 'cat gitweb.output'
+# ----------------------------------------------------------------------
+# snapshot hash ids
+
+test_expect_success \
+ 'snapshots: good treeish id' \
+ 'gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: bad treeish id' \
+ 'gitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&
+ grep "404 - Hash id was not valid" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: good object id' \
+ 'ID=`git rev-parse --verify HEAD` &&
+ gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output'
+test_debug 'cat gitweb.output'
+
+test_expect_success \
+ 'snapshots: bad object id' \
+ 'gitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&
+ grep "404 - Hash id was not valid" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
test_done
--
1.6.4.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox