Re: Bug? git worktree fails with master on bare repo

2016-10-08 Thread Kevin Daudt
On Sat, Oct 08, 2016 at 07:30:36PM -0500, Michael Tutty wrote: > Hey all, > I'm working on some server-side software to do a merge. By using git > worktree it's possible to check out a given branch for a bare repo and > merge another branch into it. It's very fast, even with large > repositories. >

Re: %C(auto) not working as expected

2016-10-08 Thread René Scharfe
Am 09.10.2016 um 07:43 schrieb Tom Hale: $ ~/repo/git/git --version git version 2.10.0.GIT The `git-log` man page says: `auto` alone (i.e. %C(auto)) will turn on auto coloring on the next placeholders until the color is switched again. In this example: http://i.imgur.com/y3yLxk7.png I turn

A head scratcher, clone results in modified files (tested linux and cygwin) - .gitattributes file?

2016-10-08 Thread Jason Pyeron
Does anyone have any ideas as to why this clone resulted in modified files and how to prevent it? There is a .gitattributes in the tree, which says: *text=auto *.java text diff=java *.html text diff=html *.csstext *.js text *.sqltext But even then the *.bin files full of

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-08 Thread Jeff King
On Sat, Oct 08, 2016 at 10:36:13AM +0200, Johannes Schindelin wrote: > > > Maybe it's time to aim for > > > > > > git config alias.d2u.shell \ > > >'f() { git ls-files "$@" | xargs dos2unix; }; f' > > > git config alias.d2u.cdup false > > > git d2u *.c # yada! > > > > That would

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-08 Thread Jeff King
On Sun, Oct 09, 2016 at 02:01:49AM -0400, Jeff King wrote: > > So what about this? > > > > [alias] > > d2u = !dos2unix > > [alias "d2u"] > > shell = 'f() { git ls-files "$@" | xargs dos2unix; }; f' > > exec = C:/cygwin64/bin/dos2unix.exe > > > > You in

%C(auto) not working as expected

2016-10-08 Thread Tom Hale
$ ~/repo/git/git --version git version 2.10.0.GIT The `git-log` man page says: `auto` alone (i.e. %C(auto)) will turn on auto coloring on the next placeholders until the color is switched again. In this example: http://i.imgur.com/y3yLxk7.png I turn on auto colouring for green, but it seem

Re: [PATCH v10 14/14] contrib/long-running-filter: add long running filter example

2016-10-08 Thread Torsten Bögershausen
On 08.10.16 13:25, larsxschnei...@gmail.com wrote: > From: Lars Schneider > > Add a simple pass-thru filter as example implementation for the Git > filter protocol version 2. See Documentation/gitattributes.txt, section > "Filter Protocol" for more info. > Nothing wrong with code in contrib. I

Re: [PATCH v10 13/14] convert: add filter..process option

2016-10-08 Thread Torsten Bögershausen
On 09.10.16 01:06, Jakub Narębski wrote: >> + >> > +packet: git< status=abort >> > +packet: git< >> > + >> > + >> > +After the filter has processed a blob it is expected to wait for >> > +the next "key=value" list containing a c

Bug? git worktree fails with master on bare repo

2016-10-08 Thread Michael Tutty
Hey all, I'm working on some server-side software to do a merge. By using git worktree it's possible to check out a given branch for a bare repo and merge another branch into it. It's very fast, even with large repositories. The only exception seems to be merging to master. When I do git worktree

Re: [PATCH v10 13/14] convert: add filter..process option

2016-10-08 Thread Jakub Narębski
Part 1 of review, starting with the protocol v2 itself. W dniu 08.10.2016 o 13:25, larsxschnei...@gmail.com pisze: > From: Lars Schneider > > Git's clean/smudge mechanism invokes an external filter process for > every single blob that is affected by a filter. If Git filters a lot of > blobs then

Re: Feature request: use relative path in worktree config files

2016-10-08 Thread Stéphane Klein
I've write a small tool in Golang to fix this issue: https://github.com/harobed/fix-git-worktree 2016-10-08 11:35 GMT+02:00 Stéphane Klein : > Hi, > > "git worktree add" write absolute path in ".git/gitdir" > > The code source is here > https://git.kernel.org/cgit/git/git.git/tree/builtin/worktree

[PATCH] use strbuf_add_unique_abbrev() for adding short hashes, part 3

2016-10-08 Thread René Scharfe
Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs instead of taking detours through find_unique_abbrev() and its static buffer. This is shorter in most cases and a bit more efficient. The changes here are not easily handled by a semantic patch because they involve removing temp

[PATCH] remove unnecessary NULL check before free(3)

2016-10-08 Thread René Scharfe
free(3) handles NULL pointers just fine. Add a semantic patch for removing unnecessary NULL checks before calling this function, and apply it on the code base. Signed-off-by: Rene Scharfe --- contrib/coccinelle/free.cocci | 5 + parse-options-cb.c| 3 +-- 2 files changed, 6 inse

Re: [PATCH] remote.c: free previous results when looking for a ref match

2016-10-08 Thread René Scharfe
Am 08.10.2016 um 01:58 schrieb Stefan Beller: Signed-off-by: Stefan Beller --- remote.c | 4 1 file changed, 4 insertions(+) diff --git a/remote.c b/remote.c index ad6c542..5f9afb4 100644 --- a/remote.c +++ b/remote.c @@ -833,6 +833,8 @@ static int match_name_with_pattern(const char *key,

[PATCH v10 04/14] run-command: add clean_on_exit_handler

2016-10-08 Thread larsxschneider
From: Lars Schneider Some processes might want to perform cleanup tasks before Git kills them due to the 'clean_on_exit' flag. Let's give them an interface for doing this. The feature is used in a subsequent patch. Please note, that the cleanup callback is not executed if Git dies of a signal. T

[PATCH v10 03/14] run-command: move check_pipe() from write_or_die to run_command

2016-10-08 Thread larsxschneider
From: Lars Schneider Move check_pipe() to run_command and make it public. This is necessary to call the function from pkt-line in a subsequent patch. While at it, make async_exit() static to run_command.c as it is no longer used from outside. Signed-off-by: Lars Schneider Signed-off-by: Ramsay

[PATCH v10 09/14] pkt-line: add packet_write_gently()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and does not die in case of an error. The functio

[PATCH v10 05/14] pkt-line: rename packet_write() to packet_write_fmt()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_write() should be called packet_write_fmt() because it is a printf-like function that takes a format string as first parameter. packet_write_fmt() should be used for text strings only. Arbitrary binary data should use a new packet_write() function that is introduced i

[PATCH v10 08/14] pkt-line: add packet_flush_gently()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet like packet_flush() but does not die in case of an error. The function is used in a subsequent patch. S

[PATCH v10 07/14] pkt-line: add packet_write_fmt_gently()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line like packet_write_fmt() but does not die in case of an error. The function is used in a subsequent

[PATCH v10 12/14] convert: prepare filter..process option

2016-10-08 Thread larsxschneider
From: Lars Schneider Refactor the existing 'single shot filter mechanism' and prepare the new 'long running filter mechanism'. Signed-off-by: Lars Schneider --- convert.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff

[PATCH v10 06/14] pkt-line: extract set_packet_header()

2016-10-08 Thread larsxschneider
From: Lars Schneider Extracted set_packet_header() function converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions could use it. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- pkt-line.c | 19 +-- 1 fi

[PATCH v10 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-08 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_strbuf() reads arbitrary sized

[PATCH v10 14/14] contrib/long-running-filter: add long running filter example

2016-10-08 Thread larsxschneider
From: Lars Schneider Add a simple pass-thru filter as example implementation for the Git filter protocol version 2. See Documentation/gitattributes.txt, section "Filter Protocol" for more info. Signed-off-by: Lars Schneider --- Documentation/gitattributes.txt| 4 +- contrib/long-runn

[PATCH v10 11/14] convert: make apply_filter() adhere to standard Git error handling

2016-10-08 Thread larsxschneider
From: Lars Schneider apply_filter() returns a boolean that tells the caller if it "did convert or did not convert". The variable `ret` was used throughout the function to track errors whereas `1` denoted success and `0` failure. This is unusual for the Git source where `0` denotes success. Renam

[PATCH v10 13/14] convert: add filter..process option

2016-10-08 Thread larsxschneider
From: Lars Schneider Git's clean/smudge mechanism invokes an external filter process for every single blob that is affected by a filter. If Git filters a lot of blobs then the startup time of the external filter processes can become a significant part of the overall Git execution time. In a prel

[PATCH v10 00/14] Git filter protocol

2016-10-08 Thread larsxschneider
From: Lars Schneider The goal of this series is to avoid launching a new clean/smudge filter process for each file that is filtered. A short summary about v1 to v5 can be found here: https://git.github.io/rev_news/2016/08/17/edition-18/ This series is also published on web: https://github.com/l

[PATCH v10 01/14] convert: quote filter names in error messages

2016-10-08 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletio

[PATCH v10 02/14] convert: modernize tests

2016-10-08 Thread larsxschneider
From: Lars Schneider Use `test_config` to set the config, check that files are empty with `test_must_be_empty`, compare files with `test_cmp`, and remove spaces after ">" and "<". Please note that the "rot13" filter configured in "setup" keeps using `git config` instead of `test_config` because

Feature request: use relative path in worktree config files

2016-10-08 Thread Stéphane Klein
Hi, "git worktree add" write absolute path in ".git/gitdir" The code source is here https://git.kernel.org/cgit/git/git.git/tree/builtin/worktree.c?h=v2.10.1#n256 Is it possible to use relative path in this config files: * [main_worktree]/.git/worktrees/[worktree_foobar]/gitdir * [worktree_foob

Re: [PATCH v2 05/25] sequencer: allow the sequencer to take custody of malloc()ed data

2016-10-08 Thread Johannes Schindelin
Hi Junio, On Thu, 6 Oct 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > If you prefer to accept such sloppy work, I will change it of course, > > feeling dirty that it has my name on it. > > I do want neither leaks nor sloppyness, and I thought that was > understood by everybod

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-08 Thread Johannes Schindelin
Hi Peff & Hannes, On Fri, 7 Oct 2016, Jeff King wrote: > On Fri, Oct 07, 2016 at 07:42:35PM +0200, Johannes Sixt wrote: > > > Maybe it's time to aim for > > > > git config alias.d2u.shell \ > >'f() { git ls-files "$@" | xargs dos2unix; }; f' > > git config alias.d2u.cdup false > >

Re: [PATCH v4 4/4] mergetool: honor -O

2016-10-08 Thread Johannes Sixt
With this final fixup, the series looks good to me, and I have no further comments. Reviewed-by: Johannes Sixt -- Hannes