Re: [PATCH] builtin/worktree.c: add option for setting worktree name

2016-06-26 Thread Barret Rennie
> On Jun 26, 2016, at 5:00 PM, Eric Sunshine wrote: > > On Sat, Jun 25, 2016 at 3:45 PM, Junio C Hamano wrote: >> [...snip...] >> And explained that way, it becomes clearer that you would want to >> name $HOME/xyzzy-1/frotz worktree after "topic-1",

Re: [PATCH v12 04/20] index-helper: new daemon for caching index and related stuff

2016-06-26 Thread Duy Nguyen
On Sun, Jun 26, 2016 at 9:29 PM, David Turner wrote: > On 06/26/2016 12:27 AM, Duy Nguyen wrote: >> >> On Sat, Jun 25, 2016 at 9:21 PM, David Turner wrote: >>> >>> On 06/25/2016 10:33 AM, Duy Nguyen wrote: > > > + /* > +

Re: [PATCH v4 5/5] fetch: reduce duplicate in ref update status lines with placeholder

2016-06-26 Thread Duy Nguyen
On Mon, Jun 27, 2016 at 6:33 AM, Eric Sunshine wrote: > On Sun, Jun 26, 2016 at 1:58 AM, Nguyễn Thái Ngọc Duy > wrote: >> In the "remote -> local" line, if either ref is a substring of the >> other, the common part in the other string is replaced with

Re: [PATCH] builtin/worktree.c: add option for setting worktree name

2016-06-26 Thread Barret Rennie
> On Jun 26, 2016, at 12:15 PM, Junio C Hamano wrote: > > Junio C Hamano writes: > >> Now, if you do the worktree, you may still want the relative >> structure between these two, i.e. if you want to work on two >> different branch combinations of the

[RFC] Native access to Git LFS cache

2016-06-26 Thread larsxschneider
From: Lars Schneider Hi, I found a way to make Git LFS faster up to a factor of 100x in repositories with a large number of Git LFS files. I am looking for comments if my approach would be acceptable by the Git community. ## What is Git LFS? Git LFS [1] is an

Re: [PATCH v4 5/5] fetch: reduce duplicate in ref update status lines with placeholder

2016-06-26 Thread Eric Sunshine
On Sun, Jun 26, 2016 at 1:58 AM, Nguyễn Thái Ngọc Duy wrote: > In the "remote -> local" line, if either ref is a substring of the > other, the common part in the other string is replaced with "$". For > example > > abc-> origin/abc > refs/pull/123/head

[PATCHv2 1/2] xread: retry after poll on EAGAIN/EWOULDBLOCK

2016-06-26 Thread Eric Wong
Jeff King wrote: > On Sun, Jun 26, 2016 at 11:21:11PM +, Eric Wong wrote: > > > We should continue to loop after EAGAIN/EWOULDBLOCK as the > > intent of xread is to read as much as possible until an > > EOF or real error occurs. > > BTW, a minor nit here. xread() does _not_

Re: [PATCH 1/2] xread: retry after poll on EAGAIN/EWOULDBLOCK

2016-06-26 Thread Jeff King
On Sun, Jun 26, 2016 at 11:21:11PM +, Eric Wong wrote: > We should continue to loop after EAGAIN/EWOULDBLOCK as the > intent of xread is to read as much as possible until an > EOF or real error occurs. BTW, a minor nit here. xread() does _not_ read as much as possible until EOF. It tries

Re: [PATCH 2/2] xwrite: poll on non-blocking FDs

2016-06-26 Thread Jeff King
On Sun, Jun 26, 2016 at 11:21:12PM +, Eric Wong wrote: > write(2) can hit the same EAGAIN/EWOULDBLOCK errors as read(2), > so busy-looping on a non-blocking FD is a waste of resources. > > Currently, I do not know of a way for this happen: > > * the NonBlocking directive in systemd does not

Re: [PATCH 1/2] xread: retry after poll on EAGAIN/EWOULDBLOCK

2016-06-26 Thread Jeff King
On Sun, Jun 26, 2016 at 11:21:11PM +, Eric Wong wrote: > We should continue to loop after EAGAIN/EWOULDBLOCK as the > intent of xread is to read as much as possible until an > EOF or real error occurs. > > Fixes: 1079c4be0b720 ("xread: poll on non blocking fds") > > Signed-off-by: Eric Wong

Re: [PATCH v12 04/20] index-helper: new daemon for caching index and related stuff

2016-06-26 Thread Eric Wong
David Turner wrote: > On 06/26/2016 04:53 AM, Eric Wong wrote: > >David Turner wrote: > >>On 06/25/2016 10:33 AM, Duy Nguyen wrote: > + /* > +* Our connection to the client is blocking since a client > +

[PATCH 2/2] xwrite: poll on non-blocking FDs

2016-06-26 Thread Eric Wong
write(2) can hit the same EAGAIN/EWOULDBLOCK errors as read(2), so busy-looping on a non-blocking FD is a waste of resources. Currently, I do not know of a way for this happen: * the NonBlocking directive in systemd does not apply to stdin, stdout, or stderr. * xinetd provides no way to set

[PATCH 1/2] xread: retry after poll on EAGAIN/EWOULDBLOCK

2016-06-26 Thread Eric Wong
We should continue to loop after EAGAIN/EWOULDBLOCK as the intent of xread is to read as much as possible until an EOF or real error occurs. Fixes: 1079c4be0b720 ("xread: poll on non blocking fds") Signed-off-by: Eric Wong --- wrapper.c | 1 + 1 file changed, 1 insertion(+)

[PATCH 0/2] wrapper: xread/xwrite fixes for non-blocking FDs

2016-06-26 Thread Eric Wong
1/2 fixes a bug introduced in commit 1079c4be0b720 ("xread: poll on non blocking fds") where the "continue" got dropped. I noticed the 1/2 bug while working on 2/2 and intentionally triggering EAGAIN on a custom HTTP server to test 100% CPU usage. I originally blindly copied the branch from

Re: [PATCH/RFC 3/3] diff.c: add --relative-names to be used with --name-only

2016-06-26 Thread Eric Sunshine
On Sun, Jun 26, 2016 at 1:16 PM, Nguyễn Thái Ngọc Duy wrote: > The difference with --relative option is, this option does not filter > paths outside cwd. You can add two more chars " ." on your command > line for that. > > This serves two purposes > > - user friendlier to

Re: [PATCH] builtin/worktree.c: add option for setting worktree name

2016-06-26 Thread Eric Sunshine
On Sat, Jun 25, 2016 at 3:45 PM, Junio C Hamano wrote: > [...snip...] > And explained that way, it becomes clearer that you would want to > name $HOME/xyzzy-1/frotz worktree after "topic-1", not the default > name you would get "frotz" (because the default gives you the leaf >

[RFC/PATCH 2/3] bisect--helper: `bisect_next_check` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement `bisect_next_check` shell function in C and add `bisect-next-check` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `--bisect-next-check` is a temporary measure to port shell function to C so as to use the existing test suite. As more functions are ported,

[RFC/PATCH 3/3] bisect--helper: `get_terms` & `bisect_terms` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement the `get_terms` and `bisect_terms` shell function in C and add `bisect-terms` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `--bisect-terms` subcommand is a temporary measure to port shell function in C so as to use the existing test suite. As more functions

[RFC/PATCH 1/3] bisect--helper: `check_and_set_terms` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement the `check_and_set_terms` shell function in C and add `check-and-set-terms` subcommand to `git bisect--helper` to call it from git-bisect.sh Using `--check-and-set-terms` subcommand is a temporary measure to port shell function in C so as to use the existing test suite. As more

Re: [PATCH v12 04/20] index-helper: new daemon for caching index and related stuff

2016-06-26 Thread David Turner
On 06/26/2016 12:27 AM, Duy Nguyen wrote: On Sat, Jun 25, 2016 at 9:21 PM, David Turner wrote: On 06/25/2016 10:33 AM, Duy Nguyen wrote: + /* +* Our connection to the client is blocking since a client +* can always be killed

Re: [PATCH] config: add conditional include

2016-06-26 Thread Jeff King
On Sun, Jun 26, 2016 at 09:06:17AM +0200, Nguyễn Thái Ngọc Duy wrote: > If the path argument in "include" starts with "gitdir:", it is > followed by a wildmatch pattern. The include is only effective if > $GIT_DIR matches the pattern. This is very useful to add configuration > to a group of

Re: [PATCH] builtin/worktree.c: add option for setting worktree name

2016-06-26 Thread Junio C Hamano
Junio C Hamano writes: > Now, if you do the worktree, you may still want the relative > structure between these two, i.e. if you want to work on two > different branch combinations of the whole thing, you would want to > do this: > > $HOME/xyzzy-1/frotz - borrow from

[PATCH v13 20/20] index-helper: indexhelper.exitafter config

2016-06-26 Thread David Turner
From: David Turner Add a configuration variable, indexhelper.exitafter, which provides a default time to keep the index-helper alive. This is useful with indexhelper.autorun; some users will want to keep the automatically-run index-helper alive across their lunch break

Re: [PATCH v12 04/20] index-helper: new daemon for caching index and related stuff

2016-06-26 Thread David Turner
On 06/26/2016 04:53 AM, Eric Wong wrote: David Turner wrote: On 06/25/2016 10:33 AM, Duy Nguyen wrote: + /* +* Our connection to the client is blocking since a client +* can always be killed by SIGINT or similar. +

[PATCH 2/3] diff.c: separate "prefix" from RELATIVE_NAME (aka --relative)

2016-06-26 Thread Nguyễn Thái Ngọc Duy
So far "prefix" and "prefix_length" in struct diff_options are tied to RELATIVE_NAME flag, making it tricky to add new features that need the prefix. This change essentially follows the foot steps in cd676a5 (diff --relative: output paths as relative to the current subdirectory - 2008-02-12) and

[PATCH/RFC 3/3] diff.c: add --relative-names to be used with --name-only

2016-06-26 Thread Nguyễn Thái Ngọc Duy
The difference with --relative option is, this option does not filter paths outside cwd. You can add two more chars " ." on your command line for that. This serves two purposes - user friendlier to copy/paste. When full paths are shown, you can still use ":/" magic to get around it, but

[PATCH 1/3] diff.c: refactor strip_prefix()

2016-06-26 Thread Nguyễn Thái Ngọc Duy
By passing "struct diff_options *" to strip_prefix(), we can do some more intelligent and repeated logic at one place. The removal of "if (opt->prefix_length)" is just the beginning. Signed-off-by: Nguyễn Thái Ngọc Duy --- diff.c | 24 ++-- 1 file changed,

[PATCH 0/3] diff: add --relative-names

2016-06-26 Thread Nguyễn Thái Ngọc Duy
For more explanation head straight to 3/3. The first two patches are preparation. Nguyễn Thái Ngọc Duy (3): diff.c: refactor strip_prefix() diff.c: separate "prefix" from RELATIVE_NAME (aka --relative) diff.c: add --relative-names to be used with --name-only Documentation/diff-options.txt

[PATCH v3 5/6] bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement `is_expected_rev` & `check_expected_revs` shell function in C and add a `--check-expected-revs` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `--check-expected-revs` subcommand is a temporary measure to port shell functions to C so as to use the existing

[PATCH v3 4/6] bisect--helper: `bisect_reset` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement `bisect_reset` shell function in C and add a `--bisect-reset` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `bisect_reset` subcommand is a temporary measure to port shell functions to C so as to use the existing test suite. As more functions are ported, this

[PATCH v3 6/6] bisect--helper: `bisect_write` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement the `bisect_write` shell function in C and add a `bisect-write` subcommand to `git bisect--helper` to call it from git-bisect.sh Using `--bisect-write` subcommand is a temporary measure to port shell function in C so as to use the existing test suite. As more functions are ported,

[PATCH v3 3/6] wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()

2016-06-26 Thread Pranit Bauva
is_empty_file() can help to refactor a lot of code. This will be very helpful in porting "git bisect" to C. Suggested-by: Torsten Bögershausen Mentored-by: Lars Schneider Mentored-by: Christian Couder Signed-off-by: Pranit Bauva

[PATCH v3 2/6] t6030: explicitly test for bisection cleanup

2016-06-26 Thread Pranit Bauva
This is not an improvement in the test coverage but it helps in making it explicit as to what exactly would be the error as other tests are focussed on testing other things. Mentored-by: Lars Schneider Mentored-by: Christian Couder

[PATCH v3 1/6] bisect--helper: `bisect_clean_state` shell function in C

2016-06-26 Thread Pranit Bauva
Reimplement `bisect_clean_state` shell function in C and add a `bisect-clean-state` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `--bisect-clean-state` subcommand is a measure to port shell function to C so as to use the existing test suite. As more functions are

[PATCH v3 0/6] convert various shell functions in git-bisect to C

2016-06-26 Thread Pranit Bauva
The major change introduced in this version is that I have used `struct bisect_terms` to store term_good and term_bad and then I am passing around the memory address of it to functions. Also I have made various changes in accordance with the previous review. Here is the link for v2.

[PATCH v13 21/20] unix-socket.c: add stub implementation when unix sockets are not supported

2016-06-26 Thread Nguyễn Thái Ngọc Duy
This keeps #ifdef at the callee instead of caller, it's less messier. The caller in question is in read-cache.c which, unlike other unix-socket callers so far, is always built regardless of unix socket support. No extra handling (for ENOSYS) is needed because in this build, index-helper does not

[PATCH] connect: read $GIT_SSH_COMMAND from config file

2016-06-26 Thread Nguyễn Thái Ngọc Duy
Similar to $GIT_ASKPASS or $GIT_PROXY_COMMAND, we also read from config file first then fall back to $GIT_SSH_COMMAND. This is useful for selecting different private keys targetting the same host (e.g. github) Signed-off-by: Nguyễn Thái Ngọc Duy --- core.gitProxy can also be

Re: [PATCH v12 04/20] index-helper: new daemon for caching index and related stuff

2016-06-26 Thread Eric Wong
David Turner wrote: > On 06/25/2016 10:33 AM, Duy Nguyen wrote: > >>+ /* > >>+* Our connection to the client is blocking since a client > >>+* can always be killed by SIGINT or similar. > >>+*/ > >>+

[PATCH] config: add conditional include

2016-06-26 Thread Nguyễn Thái Ngọc Duy
If the path argument in "include" starts with "gitdir:", it is followed by a wildmatch pattern. The include is only effective if $GIT_DIR matches the pattern. This is very useful to add configuration to a group of repositories. For convenience - "~" is expanded to $USER - if the pattern ends

Re: [PATCH] diff: let --output= default to --no-color

2016-06-26 Thread Johannes Schindelin
Hi Junio, On Fri, 24 Jun 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > It is highly unlikely that any user would want to see ANSI color > > sequences in a file. So let's stop doing that by default. > > > > This is a backwards-incompatible change. >

Re: [PATCH v4 01/10] Prepare log/log-tree to reuse the diffopt.close_file attribute

2016-06-26 Thread Johannes Schindelin
Hi Junio, On Fri, 24 Jun 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > diff --git a/builtin/log.c b/builtin/log.c > > index 099f4f7..27bc88d 100644 > > --- a/builtin/log.c > > +++ b/builtin/log.c > > @@ -243,9 +243,10 @@ static struct itimerval

Re: [PATCH v4 06/10] format-patch: explicitly switch off color when writing to files

2016-06-26 Thread Johannes Schindelin
Hi Junio, On Fri, 24 Jun 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > We rely on the auto-detection ("is stdout a terminal?") to determine > > whether to use color in the output of format-patch or not. That > > happens to work because we freopen()