Re: git_inetd_server: run git-http-backend using inetd

2014-07-20 Thread Torsten Bögershausen
On 07/19/2014 07:06 PM, Jonathan Nieder wrote: Torsten Bögershausen wrote: Jonathan, (I'm good in searching, but bad in finding) could you point out where the source code for the git package for debian is ? I recently learned about mDNS, and will probably do some tests and experiments later,

[PATCH v2] add documentation for writing config files

2014-07-20 Thread Tanay Abhra
Replace TODO introduced in commit 9c3c22 with documentation explaining Git config API functions for writing configuration files. Signed-off-by: Tanay Abhra tanay...@gmail.com --- Minor nit corrected. Thanks for the review. Documentation/technical/api-config.txt | 31

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-20 Thread René Scharfe
Am 20.07.2014 02:29, schrieb Karsten Blees: unix-socket.c: This looks pretty broken. The cd / cd back logic is only ever used if the socket path is too long. In this case, after cd'ing to the parent directory of the socket, unix_stream_listen tries to unlink the *original* socket path, instead

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-20 Thread René Scharfe
Am 20.07.2014 01:55, schrieb Karsten Blees: Am 18.07.2014 13:32, schrieb René Scharfe: Am 18.07.2014 01:03, schrieb Karsten Blees: Am 17.07.2014 19:05, schrieb René Scharfe: Am 17.07.2014 14:45, schrieb Nguyễn Thái Ngọc Duy: [...] These routines have traditionally been used by programs to

[PATCH 0/3] getcwd without PATH_MAX

2014-07-20 Thread René Scharfe
Paths longer than PATH_MAX can be created and used on at least on some file systems. Currently we use getcwd() generally with a PATH_MAX- sized buffer. This short series adds two functions, strbuf_add_cwd() and xgetcwd(), then uses them to reduce the number of fixed-sized buffers and to allow us

[PATCH 1/3] strbuf: add strbuf_add_cwd()

2014-07-20 Thread René Scharfe
Add strbuf_add_cwd(), which adds the current working directory to a strbuf. Because it doesn't use a fixed-size buffer it supports arbitrarily long paths, as long as the platform's getcwd() does as well. At least on Linux and FreeBSD it handles paths longer than PATH_MAX just fine.

[PATCH 2/3] wrapper: add xgetcwd()

2014-07-20 Thread René Scharfe
Add the helper function xgetcwd(), which returns the current directory or dies. The returned string has to be free()d after use. Signed-off-by: Rene Scharfe l@web.de --- git-compat-util.h | 1 + wrapper.c | 8 2 files changed, 9 insertions(+) diff --git a/git-compat-util.h

[PATCH 3/3] use xgetcwd() get the current directory or die

2014-07-20 Thread René Scharfe
Convert several calls of getcwd() and die() to use xgetcwd() instead. This way we get rid of fixed-size buffers (which can be too small depending on the used file system) and gain consistent error messages. Signed-off-by: Rene Scharfe l@web.de --- builtin/init-db.c | 17 -

[PATCH v2 1/2] lockfile.c: remove PATH_MAX limitation (except in resolve_symlink)

2014-07-20 Thread Nguyễn Thái Ngọc Duy
Something extra is, because struct lock_file is usually used as static variables in many places. This patch reduces bss section by about 80k bytes (or 23%) on Linux. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- This helps remove the length check in v1 of the next patch. cache.h

[PATCH v2 2/2] Make locked paths absolute when current directory is changed

2014-07-20 Thread Nguyễn Thái Ngọc Duy
Locked paths are saved in a linked list so that if something wrong happens, *.lock are removed. This works fine if we keep cwd the same, which is true 99% of time except: - update-index and read-tree hold the lock on $GIT_DIR/index really early, then later on may call setup_work_tree() to

Re: [PATCH 1/3] strbuf: add strbuf_add_cwd()

2014-07-20 Thread Duy Nguyen
On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe l@web.de wrote: +int strbuf_add_cwd(struct strbuf *sb) +{ + size_t oldalloc = sb-alloc; + size_t guessed_len = 32; For Linux, I think this is enough to succesfully get cwd in the first pass. Windows' $HOME is usually deep in

Re: [PATCH 2/3] wrapper: add xgetcwd()

2014-07-20 Thread Duy Nguyen
On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe l@web.de wrote: +char *xgetcwd(void) +{ + struct strbuf sb = STRBUF_INIT; + if (strbuf_add_cwd(sb)) + die_errno(unable to get current working directory); Wrap the string with _() to make it translatable? I can't see

Re: [PATCH 3/3] use xgetcwd() get the current directory or die

2014-07-20 Thread Duy Nguyen
On Sun, Jul 20, 2014 at 6:22 PM, René Scharfe l@web.de wrote: Convert several calls of getcwd() and die() to use xgetcwd() instead. This way we get rid of fixed-size buffers (which can be too small depending on the used file system) and gain consistent error messages. Signed-off-by: Rene

Re: [PATCH v2 1/2] lockfile.c: remove PATH_MAX limitation (except in resolve_symlink)

2014-07-20 Thread Philip Oakley
From: Nguyễn Thái Ngọc Duy pclo...@gmail.com Something extra is, because struct lock_file is usually used as static variables in many places. This patch reduces bss section by about 80k bytes (or 23%) on Linux. This didn't scan for me. Perhaps it's the punctuation. Maybe: Additionally,

Re: [PATCH v2 1/2] lockfile.c: remove PATH_MAX limitation (except in resolve_symlink)

2014-07-20 Thread Duy Nguyen
On Sun, Jul 20, 2014 at 7:47 PM, Philip Oakley philipoak...@iee.org wrote: From: Nguyễn Thái Ngọc Duy pclo...@gmail.com Something extra is, because struct lock_file is usually used as static variables in many places. This patch reduces bss section by about 80k bytes (or 23%) on Linux. This

Re: [PATCH 3/3] use xgetcwd() get the current directory or die

2014-07-20 Thread René Scharfe
Am 20.07.2014 14:45, schrieb Duy Nguyen: On Sun, Jul 20, 2014 at 6:22 PM, René Scharfe l@web.de wrote: Convert several calls of getcwd() and die() to use xgetcwd() instead. This way we get rid of fixed-size buffers (which can be too small depending on the used file system) and gain

Re: [PATCH 1/3] strbuf: add strbuf_add_cwd()

2014-07-20 Thread René Scharfe
Am 20.07.2014 14:33, schrieb Duy Nguyen: On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe l@web.de wrote: +int strbuf_add_cwd(struct strbuf *sb) +{ + size_t oldalloc = sb-alloc; + size_t guessed_len = 32; For Linux, I think this is enough to succesfully get cwd in the first pass.

Re: [PATCH 2/3] wrapper: add xgetcwd()

2014-07-20 Thread René Scharfe
Am 20.07.2014 14:35, schrieb Duy Nguyen: On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe l@web.de wrote: +char *xgetcwd(void) +{ + struct strbuf sb = STRBUF_INIT; + if (strbuf_add_cwd(sb)) + die_errno(unable to get current working directory); Wrap the string with

Re: git_inetd_server: run git-http-backend using inetd

2014-07-20 Thread Torsten Bögershausen
On 07/20/2014 08:10 AM, Torsten Bögershausen wrote: On 07/19/2014 07:06 PM, Jonathan Nieder wrote: Torsten Bögershausen wrote: Jonathan, (I'm good in searching, but bad in finding) could you point out where the source code for the git package for debian is ? I recently learned about mDNS,

[PATCH v2 0/4] getcwd without PATH_MAX

2014-07-20 Thread René Scharfe
Paths longer than PATH_MAX can be created and used on at least on some file systems. Currently we use getcwd() generally with a PATH_MAX- sized buffer. This series adds two functions, strbuf_getcwd() and xgetcwd(), then uses them to reduce the number of fixed-sized buffers and to allow us to

[PATCH v2 1/4] strbuf: add strbuf_getcwd()

2014-07-20 Thread René Scharfe
Add strbuf_getcwd(), which puts the current working directory intto a strbuf. Because it doesn't use a fixed-size buffer it supports arbitrarily long paths, as long as the platform's getcwd() does as well. At least on Linux and FreeBSD it handles paths longer than PATH_MAX just fine.

[PATCH v2 2/4] use strbuf_getcwd() to get the current working directory without fixed-sized buffers

2014-07-20 Thread René Scharfe
Signed-off-by: Rene Scharfe l@web.de --- builtin/init-db.c | 8 git.c | 6 -- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index 56f85e2..c4958b6 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -535,10

[PATCH v2 3/4] wrapper: add xgetcwd()

2014-07-20 Thread René Scharfe
Add the helper function xgetcwd(), which returns the current directory or dies. The returned string has to be free()d after use. Helped-by: Duy Nguyen pclo...@gmail.com Signed-off-by: Rene Scharfe l@web.de --- git-compat-util.h | 1 + wrapper.c | 8 2 files changed, 9

[PATCH v2 4/4] use xgetcwd() get the current directory or die

2014-07-20 Thread René Scharfe
Convert several calls of getcwd() and die() to use xgetcwd() instead. This way we get rid of fixed-size buffers (which can be too small depending on the used file system) and gain consistent error messages. Signed-off-by: Rene Scharfe l@web.de --- builtin/init-db.c | 17 -

Re: [PATCH] Add failing test: fsck survives inflate errors

2014-07-20 Thread Samuel Bronson
The following message is a courtesy copy of an article that has been posted to gmane.comp.version-control.git as well. Oh, I forgot to provide any analysis of the problem. Oops. It may be just as well, though; I was tired enough that I might have botched it in any case. So, have an analysis:

Re: [PATCH v1] rebase --root: sentinel commit cloaks empty commits

2014-07-20 Thread Chris Webb
Thomas Rast t...@thomasrast.ch wrote: Please take a closer look at the last two test cases that specify the expected behaviour of rebasing a branch that tracks the empty tree. At this point they expect the Nothing to do error (aborts with untouched history). This is consistent with rebasing

scan.coverity: improve the modeling file of git.git

2014-07-20 Thread Stefan Beller
Hi Sam, John and Jeff, I'm writing to you, as you're listed as the administrator of the git.git project on scan.coverity.com We're currently seeing lots of false positives as the xmalloc/xrealloc function is handled not properly by coverity. There are lots of errors Allocation too small for

Re: [PATCH v7 23/31] checkout: clean up half-prepared directories in --to mode

2014-07-20 Thread Eric Sunshine
On Sun, Jul 13, 2014 at 12:51 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/checkout.c | 49 +++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-20 Thread Jeff King
On Sun, Jul 20, 2014 at 10:00:41AM +0200, René Scharfe wrote: -- 8 -- Subject: [PATCH] unix-socket: remove stale socket before calling chdir() unix_stream_listen() is given a path. It calls unix_sockaddr_init(), which in turn can call chdir(). After that a relative path doesn't mean the

Re: [PATCH v2 2/4] use strbuf_getcwd() to get the current working directory without fixed-sized buffers

2014-07-20 Thread Jeff King
On Sun, Jul 20, 2014 at 06:49:54PM +0200, René Scharfe wrote: diff --git a/builtin/init-db.c b/builtin/init-db.c index 56f85e2..c4958b6 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -535,10 +535,10 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)

Re: [PATCH v7 23/31] checkout: clean up half-prepared directories in --to mode

2014-07-20 Thread Eric Sunshine
On Sun, Jul 20, 2014 at 7:55 PM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sun, Jul 13, 2014 at 12:51 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: + + junk_pid = getpid(); + atexit(remove_junk); + sigchain_push_common(remove_junk_on_signal); + if

Re: inotify support, nearly there

2014-07-20 Thread Juan P
Duy Nguyen pclouds at gmail.com writes: Just a quick update for the enthusiasts. My branch file-watcher [1] has got working per-user inotify support. It's a 20 patch series so I'll refrain from spamming git at vger for a while, even though it hurts your eyes a lot less than what I have