Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases

2014-07-20 Thread mimimimi
I set up a git alias like this: git config --global alias.popmerge '!git stash pop && git merge master' Then I call it, like this: git popmerge The "git stash pop" is executed, but the "git merge master" is ignored. If I run "git merge master" right after the "git popmerge"... it sumply runs a

Re: inotify support, nearly there

2014-07-20 Thread Juan P
Duy Nguyen 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 vger for a while, even though it hurts > your eyes a lot less than what I have posted so f

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 wrote: > On Sun, Jul 13, 2014 at 12:51 AM, Nguyễn Thái Ngọc Duy > wrote: >> + >> + junk_pid = getpid(); >> + atexit(remove_junk); >> + sigchain_push_common(remove_junk_on_signal); >> + >> if (mkdir(sb_repo.buf, 0777)) >>

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] 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 > mea

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 wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > builtin/checkout.c | 49 +++-- > 1 file changed, 47 insertions(+), 2 deletions(-) > > diff --git a/builtin/checkout.c b/builtin/checkout.c > ind

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 ty

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

2014-07-20 Thread Chris Webb
Thomas Rast 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 only empty

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: W

[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 --- builtin/init-db.c | 17 - builtin/rev-p

[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 Signed-off-by: Rene Scharfe --- git-compat-util.h | 1 + wrapper.c | 8 2 files changed, 9 insertions(+) diff --git a/git-com

[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 --- 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 +535,10 @@ in

[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. Suggested-b

[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 hand

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, and

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 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

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 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 mess

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 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' $H

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 wrote: > From: "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. > > > This didn't scan for me. Perh

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" 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, because the struct loc

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 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 Scharfe

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

2014-07-20 Thread Duy Nguyen
On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe 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 why a

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 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 C:\Users\Blahb

[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 move

[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 --- This helps remove the length check in v1 of the next patch. cache.h| 2 +- lockfile

[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 --- builtin/init-db.c | 17 - builtin/rev-p

[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 --- git-compat-util.h | 1 + wrapper.c | 8 2 files changed, 9 insertions(+) diff --git a/git-compat-util.h b/git-compat

[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. Suggested-by:

[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

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 s

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, inst

[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 --- Minor nit corrected. Thanks for the review. Documentation/technical/api-config.txt | 31 ++- 1 file changed