Re: [PATCH] t7800 readlink not found

2016-05-30 Thread Junio C Hamano
Torsten Bögershausen writes: >> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh >> index 7ce4cd7..905035c 100755 >> --- a/t/t7800-difftool.sh >> +++ b/t/t7800-difftool.sh >> @@ -446,7 +446,7 @@ write_script .git/CHECK_SYMLINKS <<\EOF >> for f in file file2 sub/sub >> do

Re: [PATCH 09/13] refs: introduce an iterator interface

2016-05-30 Thread Eric Sunshine
On Mon, May 30, 2016 at 3:55 AM, Michael Haggerty wrote: > [...] > This commit introduces a new iteration primitive for references: a > ref_iterator. A ref_iterator is a polymorphic object that a reference > storage backend can be asked to instantiate. There are three

Re: [PATCH] t7800 readlink not found

2016-05-30 Thread Torsten Bögershausen
On 05/31/2016 02:26 AM, Armin Kunaschik wrote: On 05/27/2016 06:19 AM, David Aguilar wrote: On Wed, May 25, 2016 at 11:33:33AM +0200, Armin Kunaschik wrote: Would you mind submitting a patch so that we can support these tests when running on AIX/HP-UX? I don't feel comfortable to submit

Re: [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C

2016-05-30 Thread Michael Haggerty
On 05/30/2016 08:21 PM, Pranit Bauva wrote: > 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

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Michael Haggerty
On 05/30/2016 02:52 PM, Matthieu Moy wrote: > [...] I feel bad bikeshedding about names, especially since you took some of the original names from my RFC. But names are very important, so I think it's worth considering whether the current names could be improved upon. When reading this patch

Re: [PATCH 1/3] pretty: support "mboxrd" output format

2016-05-30 Thread Eric Sunshine
On Mon, May 30, 2016 at 7:21 PM, Eric Wong wrote: > This output format prevents format-patch output from breaking > readers if somebody copy+pasted an mbox into a commit message. > > Unlike the traditional "mboxo" format, "mboxrd" is designed to > be fully-reversible. "mboxrd"

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Michael Haggerty
On 05/30/2016 02:13 PM, Johannes Schindelin wrote: > [...] >> @@ -38,7 +67,11 @@ char *strbuf_detach(struct strbuf *sb, size_t *sz) >> { >> char *res; >> strbuf_grow(sb, 0); >> -res = sb->buf; >> +if (sb->flags & STRBUF_OWNS_MEMORY) >> +res = sb->buf; >> +else >>

Re: [PATCH 1/2] strbuf: add tests

2016-05-30 Thread Michael Haggerty
Hi, Cool that you are working on this! See my comments below. On 05/30/2016 12:36 PM, William Duclot wrote: > Test the strbuf API. Being used throughout all Git the API could be > considered tested, but adding specific tests makes it easier to improve > and extend the API. > --- > Makefile

Re: [PATCH 09/13] refs: introduce an iterator interface

2016-05-30 Thread Michael Haggerty
On 05/30/2016 06:57 PM, Ramsay Jones wrote: > > > On 30/05/16 16:22, Ramsay Jones wrote: >> >> >> On 30/05/16 08:55, Michael Haggerty wrote: >> [snip] >> >>> /* Reference is a symbolic reference. */ >>> diff --git a/refs/files-backend.c b/refs/files-backend.c >>> index 8ab4d5f..dbf1587 100644

[PATCH] t7800 readlink not found

2016-05-30 Thread Armin Kunaschik
On 05/27/2016 06:19 AM, David Aguilar wrote: > On Wed, May 25, 2016 at 11:33:33AM +0200, Armin Kunaschik wrote: > > Would you mind submitting a patch so that we can support these > tests when running on AIX/HP-UX? I don't feel comfortable to submit patches for tests I can't verify. I don't have

[PATCH 3/3] am: support --patch-format=mboxrd

2016-05-30 Thread Eric Wong
Combined with "git format-patch --pretty=mboxrd", this should allow us to round-trip commit messages with embedded mbox "From " lines without corruption. Signed-off-by: Eric Wong --- Documentation/git-am.txt | 3 ++- builtin/am.c | 14 +++--- t/t4150-am.sh

[PATCH 2/3] mailsplit: support unescaping mboxrd messages

2016-05-30 Thread Eric Wong
This will allow us to parse the output of --pretty=mboxrd and the output of other mboxrd generators. Signed-off-by: Eric Wong --- Documentation/git-mailsplit.txt | 7 ++- builtin/mailsplit.c | 23 +++ t/t5100-mailinfo.sh | 13

[PATCH 1/3] pretty: support "mboxrd" output format

2016-05-30 Thread Eric Wong
This output format prevents format-patch output from breaking readers if somebody copy+pasted an mbox into a commit message. Unlike the traditional "mboxo" format, "mboxrd" is designed to be fully-reversible. "mboxrd" also gracefully degrades to showing extra ">" in existing "mboxo" readers.

[RFC/PATCH 0/3] support mboxrd format

2016-05-30 Thread Eric Wong
Sometimes users will copy+paste an entire mbox into a commit message, leading to bad splits when a patch is output as an email. Unlike other mbox-family formats, mboxrd allows reversible round-tripping while avoiding bad splits for old "mboxo" readers. I'm also considering altering the current

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Mike Hommey
On Tue, May 31, 2016 at 12:46:23AM +0200, William Duclot wrote: > Mike Hommey writes: > >> struct strbuf { > >> + unsigned int flags; > >>size_t alloc; > >>size_t len; > >>char *buf; > >> }; > > > > Depending whether the size of strbuf matters, it /might/ be

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Mike Hommey writes: >> struct strbuf { >> +unsigned int flags; >> size_t alloc; >> size_t len; >> char *buf; >> }; > > Depending whether the size of strbuf matters, it /might/ be worth > considering some packing here. malloc() usually returns buffers that

Re: [PATCH] Documentation: GPG capitalization

2016-05-30 Thread Junio C Hamano
David Nicolson writes: >>> message part may contain a signature that Git itself doesn't >>> -care about, but that can be verified with gpg. >>> +care about, but that can be verified with GPG. >> >> Isn't this a name of the program, though? Other two hunks in your >>

Re: git add without whitespace

2016-05-30 Thread Junio C Hamano
Robert Dailey writes: > I like your solution better than mine because it utilizes the rules > defined in .gitattributes. A difference that may be more important is that I do not do generation of a patch or application of it without ignoring whitespaces with things like

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Mike Hommey
> struct strbuf { > + unsigned int flags; > size_t alloc; > size_t len; > char *buf; > }; Depending whether the size of strbuf matters, it /might/ be worth considering some packing here. malloc() usually returns buffers that can contain more data than what is requested.

Re: [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C

2016-05-30 Thread Christian Couder
On Mon, May 30, 2016 at 8:21 PM, Pranit Bauva wrote: > --- > This patch contains a bug. I have tried to identify the bug and I suppose it > exists in do_for_each_entry_in_dir(). I have reproduced the debugging session > at this link[1]. I have seen that some patches in

Re: [PATCH] Documentation: GPG capitalization

2016-05-30 Thread David Nicolson
On Mon, May 30, 2016 at 8:02 PM, Junio C Hamano wrote: > Dave Nicolson writes: > >> When "GPG" is used in a sentence it is now consistently capitalized. When >> referring to the binary it is left as "gpg". >> >> Signed-off-by: David Nicolson

Re: [PATCH v2 1/8] t4051: rewrite, add more tests

2016-05-30 Thread René Scharfe
Am 30.05.2016 um 01:55 schrieb Junio C Hamano: René Scharfe writes: +commit_and_tag () { + message=$1 && + shift && + git add $@ && Lack of dq around $@ makes me wonder if there is something funny going on (looking at the callers, there isn't, so we'd better

Re: git add without whitespace

2016-05-30 Thread Robert Dailey
On Mon, May 30, 2016 at 2:06 PM, Junio C Hamano wrote: > I have had this in my ~/.gitconfig for a long time. > > [alias] > wsadd = "!sh -c 'git diff -- \"$@\" | git apply --cached > --whitespace=fix;\ > git co -- ${1-.} \"$@\"' -" > > That is, "take

Re: [WIP-PATCH 0/2] send-email: refactor the email parser loop

2016-05-30 Thread Matthieu Moy
Samuel GROOT writes: > Can we consider this feature obsolete and remove it? We're usually quite conservative with backward compatibility. If we remove the feature, we may want to announce it in the next feature release and actually remove it in the one after

Re: [PATCH v5] upload-pack.c: use parse-options API

2016-05-30 Thread Junio C Hamano
Antoine Queru writes: > From: Antoine Queru Don't you want to be known to the project as the email that matches your Signed-off-by: line? > Use the parse-options API rather than a hand-rolled option parser. > >

Re: git add without whitespace

2016-05-30 Thread Junio C Hamano
Robert Dailey writes: > $ git diff -U0 -w --no-color | git apply --cached --ignore-whitespace > --unidiff-zero > > This command explicitly leaves out context because it can sometimes > cause the patch to fail to apply, I think due to whitespace being in > it, but I'm

Re: Fatal bug on revert with --author

2016-05-30 Thread Jeff King
On Mon, May 30, 2016 at 04:16:50PM +0200, Andreas Lutro wrote: > So I learned today that --author is not a supported argument to git > revert. It took me a long time to realize this, though, because the > error I got was very cryptic: > > fatal: BUG: expected exactly one commit from walk > >

Re: How to cut extra liftime of expired loose objects

2016-05-30 Thread Junio C Hamano
Jeff King writes: > I think we should consider dropping the default time to something more > like 1 day. The 2-week period predates reflogs, I believe (OTOH, it does > save objects which you might have used with "git add" but never actually > committed). Your belief is shared by

Re: How to add custom metadata to Git commit object

2016-05-30 Thread Junio C Hamano
Jeff King writes: > On Mon, May 30, 2016 at 08:58:08PM +0300, Kirill Likhodedov wrote: > ... >> There are git-notes, which could be used for the purpose, but they are >> visible to the user via standard Git command, and could be used by the >> user for other purposes, so they are

Re: [PATCH v1 0/1] t6038-merge-text-auto.sh

2016-05-30 Thread Junio C Hamano
Junio C Hamano writes: > Imagine that you started from a history where somebody recorded a > text file with CRLF in the blob, unconverted. Later the project > decided to express their text with LF to support cross-platform > development better, and sets up the Auto-CRLF.

Re: How to add custom metadata to Git commit object

2016-05-30 Thread Jeff King
On Mon, May 30, 2016 at 08:58:08PM +0300, Kirill Likhodedov wrote: > Is it possible to add custom metadata to Git commit object? Such > metadata should be ignored by Git commands, but could be used by a > 3-party tool which knows the format and knows where to look. Yes. The recommended place to

Re: [WIP-PATCH 0/2] send-email: refactor the email parser loop

2016-05-30 Thread Samuel GROOT
On 05/30/2016 04:20 PM, Matthieu Moy wrote: Is the "lots of email" format still used? AFAICT, it was initially supported for backward compatibility, and then no one removed it, but I wouldn't be surprised if no one actually used it. I vaguely remember a message from Ryan Anderson being

Re: [PATCH v3 2/3] perf: make the tests work in worktrees

2016-05-30 Thread René Scharfe
Am 30.05.2016 um 20:03 schrieb Junio C Hamano: > Johannes Schindelin writes: > >>> This breaks perf for the non-worktree case: >> >> Oh drats! >> >>> lsr@debian:~/src/git/t/perf$ make >>> rm -rf test-results >>> ./run >>> === Running 12 tests in this tree === >>> cp:

Re: How to add custom metadata to Git commit object

2016-05-30 Thread Konstantin Khomoutov
On Mon, 30 May 2016 20:58:08 +0300 Kirill Likhodedov wrote: > Is it possible to add custom metadata to Git commit object? > Such metadata should be ignored by Git commands, but could be used by > a 3-party tool which knows the format and knows where to look. >

Re: How to cut extra liftime of expired loose objects

2016-05-30 Thread Jeff King
On Mon, May 30, 2016 at 06:43:07PM +0200, Johannes Sixt wrote: > I think there is logic somewhere in git gc or its minions that gives expired > objects that have been packed a two weeks extra life time as loose objects. > > That is, reachable loose objects are moved to a pack, but those objects

[RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C

2016-05-30 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 ported,

Re: [PATCH v3 2/3] perf: make the tests work in worktrees

2016-05-30 Thread Junio C Hamano
Johannes Schindelin writes: >> This breaks perf for the non-worktree case: > > Oh drats! > >> lsr@debian:~/src/git/t/perf$ make >> rm -rf test-results >> ./run >> === Running 12 tests in this tree === >> cp: cannot stat '.git/objects': No such file or directory >>

Re: [PATCH] Documentation: GPG capitalization

2016-05-30 Thread Junio C Hamano
Dave Nicolson writes: > When "GPG" is used in a sentence it is now consistently capitalized. When > referring to the binary it is left as "gpg". > > Signed-off-by: David Nicolson > --- > Documentation/git-mktag.txt | 2 +- >

Re: [PATCH v1 0/1] t6038-merge-text-auto.sh

2016-05-30 Thread Junio C Hamano
tbo...@web.de writes: > This is a little bit of a hen-and-egg problem: > The problem comes up after the "unified auto handling". > In theory, it should have been since before: > get_sha1_from_index() says: > > * We might be in the middle of a merge, in which > * case we would read stage #2

How to add custom metadata to Git commit object

2016-05-30 Thread Kirill Likhodedov
Is it possible to add custom metadata to Git commit object? Such metadata should be ignored by Git commands, but could be used by a 3-party tool which knows the format and knows where to look. I assume that this should be possible, given that Git objects are actually patches, and patches can

[PATCH v1 0/1] t6038-merge-text-auto.sh

2016-05-30 Thread tboegi
From: Torsten Bögershausen Split of the old 10/10 series. This is the update of t6038, which is needed to motivate the patch `convert: ce_compare_data() checks for a sha1 of a path` on top of `convert: unify the "auto" handling of CRLF` When files with different eols are

Re: [PATCH 09/13] refs: introduce an iterator interface

2016-05-30 Thread Ramsay Jones
On 30/05/16 16:22, Ramsay Jones wrote: > > > On 30/05/16 08:55, Michael Haggerty wrote: > [snip] > >> /* Reference is a symbolic reference. */ >> diff --git a/refs/files-backend.c b/refs/files-backend.c >> index 8ab4d5f..dbf1587 100644 >> --- a/refs/files-backend.c >> +++

[PATCH v1 1/1] t6038: different eol for "Merge addition of text=auto"

2016-05-30 Thread tboegi
From: Torsten Bögershausen t6038 uses different code, depending if NATIVE_CRLF is set ot not. Enhance the test coverage for cross-platform testing and run "Merge addition of text=auto" with both lf and crlf as core.eol. It is important to be run this test with crlf under Linux,

How to cut extra liftime of expired loose objects

2016-05-30 Thread Johannes Sixt
I think there is logic somewhere in git gc or its minions that gives expired objects that have been packed a two weeks extra life time as loose objects. That is, reachable loose objects are moved to a pack, but those objects that were packed, but become unreachable due to expired reflogs, are

git add without whitespace

2016-05-30 Thread Robert Dailey
I think it would be useful to have a '-w' option for 'git add' that completely ignores whitespace changes, the same way that 'git diff -w' does. Real life scenario: Sometimes developers will use tooling that does not properly strip trailing whitespace in source files. Next time I edit those

Re: [PATCH 09/13] refs: introduce an iterator interface

2016-05-30 Thread Ramsay Jones
On 30/05/16 08:55, Michael Haggerty wrote: [snip] > /* Reference is a symbolic reference. */ > diff --git a/refs/files-backend.c b/refs/files-backend.c > index 8ab4d5f..dbf1587 100644 > --- a/refs/files-backend.c > +++ b/refs/files-backend.c > @@ -1,6 +1,7 @@ > #include "../cache.h" >

Re: [PATCH] push: deny policy to prevent pushes to unwanted remotes.

2016-05-30 Thread Francois Beutin
- Mail original - > Antoine Queru writes: > > > Currently, a user wanting to prevent accidental pushes to the wrong remote > > has to create a pre-push hook. > > The feature offers a configuration to allow users to prevent accidental > > pushes >

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Matthieu Moy writes: > William Duclot writes: > >> Matthieu Moy writes: +/** + * Allow the caller to give a pre-allocated piece of memory for the strbuf + * to use and

Re: [PATCH v5] upload-pack.c: use parse-options API

2016-05-30 Thread Matthieu Moy
Antoine Queru writes: > From: Antoine Queru [ Insert here the sentence I've been repeating a lot lately about this useless From ;-) ] > Documentation/git-upload-pack.txt | 16 +-- > upload-pack.c

[PATCH v5] upload-pack.c: use parse-options API

2016-05-30 Thread Antoine Queru
From: Antoine Queru Use the parse-options API rather than a hand-rolled option parser. Description for --stateless-rpc and --advertise-refs come from 42526b4 (Add stateless RPC options to upload-pack, receive-pack, 2009-10-30). Signed-off-by: Antoine

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Matthieu Moy
William Duclot writes: > Matthieu Moy writes: > >> void strbuf_grow(struct strbuf *sb, size_t extra) >> { >> int new_buf = !sb->alloc; >> ... >> if (sb->flags & STRBUF_OWNS_MEMORY) { >> if (new_buf) //

Gitweb: Persistant download URLs for snapshots?

2016-05-30 Thread Timo Sigurdsson
Hi, I hope this is the right place to ask this, but I wanted to know whether it is possible to have a persistant URL to obtain a snapshot of the latest master of a repository through Gitweb. I set up a gitweb instance and it works nicely. I can click on the snapshot link to get a tgz archive

Re: [WIP-PATCH 0/2] send-email: refactor the email parser loop

2016-05-30 Thread Matthieu Moy
Samuel GROOT writes: > (mbox) prefix was introduced by Ryan Anderson in 2005 (can't find the > exact commit though), in opposition with the (non-mbox) format ("lots > of email") that was used before. That is actually from the original commit introducing

Re: [PATCH v4] upload-pack.c: use of parse-options API

2016-05-30 Thread Antoine Queru
Hello Eric, Thank you for answer. Your remarks have been added in the next version. > > + OPT_BOOL(0, "strict", , > > +N_("do not try /.git/ if is > > no Git directory")), > > Use of OPT_BOOL introduces a --no-strict option which didn't exist > before. Does

Fatal bug on revert with --author

2016-05-30 Thread Andreas Lutro
So I learned today that --author is not a supported argument to git revert. It took me a long time to realize this, though, because the error I got was very cryptic: fatal: BUG: expected exactly one commit from walk Here's a very simple reproducible case:

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Matthieu Moy writes: > William Duclot writes: > >> @@ -20,16 +28,37 @@ char strbuf_slopbuf[1]; >> >> void strbuf_init(struct strbuf *sb, size_t hint) >> { >> +sb->flags = 0; >> sb->alloc = sb->len = 0; >>

Re: [WIP-PATCH 0/2] send-email: refactor the email parser loop

2016-05-30 Thread Samuel GROOT
On 05/29/2016 08:05 PM, Matthieu Moy wrote: Samuel GROOT writes: Should we take what Eric suggested (see below) as standard output? Since the headers are already shown after those lines, it's redundant to have the entire line. And we could add trailers after

Re: [PATCH 1/2] strbuf: add tests

2016-05-30 Thread Simon Rabourg
Hi Johannes, I'm William's teammate on this feature. Johannes Schindelin writes: > Hi William, > > On Mon, 30 May 2016, William Duclot wrote: > > > Test the strbuf API. Being used throughout all Git the API could be > > considered tested, but adding specific

Re: [WIP-PATCH 1/2] send-email: create email parser subroutine

2016-05-30 Thread Samuel GROOT
On 05/29/2016 07:53 PM, Matthieu Moy wrote: Samuel GROOT writes: So should we merge parse_email and parse_header in one unique subroutine? At least on the user (i.e. caller of the API) side, one function is probably enough. I will do that, as soon as we

Re: [PATCH] push: deny policy to prevent pushes to unwanted remotes.

2016-05-30 Thread Matthieu Moy
Antoine Queru writes: > Currently, a user wanting to prevent accidental pushes to the wrong remote > has to create a pre-push hook. > The feature offers a configuration to allow users to prevent accidental pushes > to the wrong remote. The user may define a

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Johannes Schindelin writes: > On Mon, 30 May 2016, William Duclot wrote: > >> It is unfortunate that it is currently impossible to use a strbuf >> without doing a memory allocation. So code like >> >> void f() >> { >> char path[PATH_MAX]; >> ... >> } >> >>

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Matthieu Moy
William Duclot writes: > multiple threads. Those limitations prevent strbuf to be used in prevent strbuf from being used ... > API ENHANCEMENT > --- > > All functions of the API can still be reliably called without > knowledge of the

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread Johannes Schindelin
Hi William, On Mon, 30 May 2016, William Duclot wrote: > It is unfortunate that it is currently impossible to use a strbuf > without doing a memory allocation. So code like > > void f() > { > char path[PATH_MAX]; > ... > } > > typically gets turned into either > > void f() > { >

Re: [PATCH 1/2] strbuf: add tests

2016-05-30 Thread Matthieu Moy
I agree with Johannes' remarks. I'd add two style nits: William Duclot writes: > --- /dev/null > +++ b/t/helper/test-strbuf.c > @@ -0,0 +1,69 @@ > +#include "git-compat-util.h" > +#include "strbuf.h" > + > +/* > + * Check behavior on usual use cases > +

Re: [PATCH 1/2] strbuf: add tests

2016-05-30 Thread Johannes Schindelin
Hi William, On Mon, 30 May 2016, William Duclot wrote: > Test the strbuf API. Being used throughout all Git the API could be > considered tested, but adding specific tests makes it easier to improve > and extend the API. > --- The commit message makes sense. Please add your sign-off. >

Re: [PATCH 0/2] strbuf: improve API

2016-05-30 Thread Remi Galan Alfonso
William Duclot writes: > This patch series implements an improvment of the strbuf API, allowing > strbuf to use preallocated memory. This makes strbuf fit to be used > in performance-critical operations. > > The first patch is simply a preparatory work,

Re: [PATCH v2 02/22] i18n: advice: mark string about detached head for translation

2016-05-30 Thread Vasco Almeida
Às 19:27 de 23-05-2016, Vasco Almeida escreveu: > Mark string with advice seen by the user when in detached head. > > Signed-off-by: Vasco Almeida > --- > advice.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/advice.c b/advice.c > index

[PATCH v3 0/6] worktree lock/unlock

2016-05-30 Thread Nguyễn Thái Ngọc Duy
v3 changes almost all patches so I didn't bother with interdiff [1/6] worktree.c: add find_worktree() This replaces the old find_wortree_by_path(). It now takes both prefix and command line argument so it can do some intelligent things with them if needed. [2/6] worktree.c:

[PATCH v3 5/6] worktree: add "lock" command

2016-05-30 Thread Nguyễn Thái Ngọc Duy
Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 28 +++- builtin/worktree.c | 38 +++ contrib/completion/git-completion.bash | 5

[PATCH v3 4/6] worktree.c: retrieve lock status (and optionally reason) in get_worktrees()

2016-05-30 Thread Nguyễn Thái Ngọc Duy
We need this later to avoid double locking a worktree, or unlocking one when it's not even locked. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 12 worktree.h | 1 + 2 files changed, 13 insertions(+) diff --git a/worktree.c b/worktree.c index

[PATCH v3 2/6] worktree.c: find_worktree() learns to identify worktrees by basename

2016-05-30 Thread Nguyễn Thái Ngọc Duy
This allows the user to do something like "worktree lock foo" instead of "worktree lock ". With completion support it could be quite convenient. While this base name search can be done in the same worktree iteration loop, the code is split into a separate function for clarity. Suggested-by: Eric

[PATCH v3 1/6] worktree.c: add find_worktree()

2016-05-30 Thread Nguyễn Thái Ngọc Duy
So far we haven't needed to identify an existing worktree from command line. Future commands such as lock or move will need it. The current implementation identifies worktrees by path (*). In future, the function could learn to identify by $(basename $path) or tags... (*) We could probably go

[PATCH v3 3/6] worktree.c: add is_main_worktree()

2016-05-30 Thread Nguyễn Thái Ngọc Duy
Main worktree _is_ different. You can lock a linked worktree but not the main one, for example. Provide an API for checking that. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 5 + worktree.h | 5 + 2 files changed, 10 insertions(+) diff --git a/worktree.c

[PATCH v3 6/6] worktree: add "unlock" command

2016-05-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 5 + builtin/worktree.c | 28 contrib/completion/git-completion.bash | 2 +- t/t2028-worktree-move.sh | 14 ++ 4

[PATCH] push: deny policy to prevent pushes to unwanted remotes.

2016-05-30 Thread Antoine Queru
Currently, a user wanting to prevent accidental pushes to the wrong remote has to create a pre-push hook. The feature offers a configuration to allow users to prevent accidental pushes to the wrong remote. The user may define a list of whitelisted remotes, a list of blacklisted remotes and a

[PATCH 1/2] strbuf: add tests

2016-05-30 Thread William Duclot
Test the strbuf API. Being used throughout all Git the API could be considered tested, but adding specific tests makes it easier to improve and extend the API. --- Makefile | 1 + t/helper/test-strbuf.c | 69 ++ t/t0082-strbuf.sh

[PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
It is unfortunate that it is currently impossible to use a strbuf without doing a memory allocation. So code like void f() { char path[PATH_MAX]; ... } typically gets turned into either void f() { struct strbuf path; strbuf_add(, ...); <-- does a malloc ...

[PATCH 0/2] strbuf: improve API

2016-05-30 Thread William Duclot
This patch series implements an improvment of the strbuf API, allowing strbuf to use preallocated memory. This makes strbuf fit to be used in performance-critical operations. The first patch is simply a preparatory work, adding tests for existing strbuf implementation. Most of the work is made in

Re: [PATCH v2 1/5] worktree.c: add find_worktree_by_path()

2016-05-30 Thread Duy Nguyen
On Mon, May 23, 2016 at 11:11 AM, Eric Sunshine wrote: > On Sun, May 22, 2016 at 6:43 AM, Nguyễn Thái Ngọc Duy > wrote: >> So far we haven't needed to identify an existing worktree from command >> line. Future commands such as lock or move will need

[RFC] Triangular Workflow UI improvments

2016-05-30 Thread Jordan DE GEA
> Le 27 mai 2016 à 09:32, Philip Oakley a écrit : > For me, the first step would be to actually document a (the?) Triangular > Workflow in the documentation, so we are all taking about the same broad > method. > > At the moment there is a choice (assuming a ithub like

[RFC] Triangular Workflow UI improvement

2016-05-30 Thread Jordan DE GEA
>> We are working on full implementation of triangular workflow feature. >> For now, the main options available are: >> - branch..pushRemote >> - remote.pushDefault >> And only setable by hands. > > And once it is set, you do not have to worry about it. I am not > sure per-branch

Re: [PATCH v3 2/3] perf: make the tests work in worktrees

2016-05-30 Thread Johannes Schindelin
Hi René, On Sun, 29 May 2016, René Scharfe wrote: > Am 13.05.2016 um 15:25 schrieb Johannes Schindelin: > > This patch makes perf-lib.sh more robust so that it can run correctly > > even inside a worktree. For example, it assumed that $GIT_DIR/objects is > > the objects directory (which is not

[RFC] Triangular Workflow UI improvement

2016-05-30 Thread Jordan DE GEA
In my last message, I forgot to add some important contributors linked to this feature. Some of you already replied to me. I will answer shortly. Sorry for the noise. > > We are working on full implementation of triangular workflow feature. > For now, the main options available are: >

[PATCH 05/13] remote rm: handle symbolic refs correctly

2016-05-30 Thread Michael Haggerty
In the modern world of reference backends, it is not OK to delete a symref by unlink()ing the file directly. This must be done via the refs API. We do so by adding the symref to the list of references to delete along with the non-symbolic references, then calling delete_refs() with the new flags

[PATCH 02/13] do_for_each_ref(): move docstring to the header file

2016-05-30 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 9 - refs/refs-internal.h | 10 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 1230dfb..68db3e8 100644 ---

[PATCH 09/13] refs: introduce an iterator interface

2016-05-30 Thread Michael Haggerty
Currently, the API for iterating over references is via a family of for_each_ref()-type functions that invoke a callback function for each selected reference. All of these eventually call do_for_each_ref(), which knows how to do one thing: iterate in parallel through two ref_caches, one for loose

[PATCH 04/13] delete_refs(): add a flags argument

2016-05-30 Thread Michael Haggerty
This will be useful for passing REF_NODEREF through. Signed-off-by: Michael Haggerty --- builtin/fetch.c | 2 +- builtin/remote.c | 4 ++-- refs.h | 5 +++-- refs/files-backend.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git

[PATCH 03/13] refs: use name "prefix" consistently

2016-05-30 Thread Michael Haggerty
In the context of the for_each_ref() functions, call the prefix that references must start with "prefix". (In some places it was called "base".) This is clearer, and also prevents confusion with another planned use of the word "base". Signed-off-by: Michael Haggerty ---

[PATCH 01/13] refs: remove unnecessary "extern" keywords

2016-05-30 Thread Michael Haggerty
There's continuing work in this area, so clean up unneeded "extern" keywords rather than schlepping them around. Also split up some overlong lines and add parameter names in a couple of places. Signed-off-by: Michael Haggerty --- refs.h | 132

[PATCH 10/13] do_for_each_ref(): reimplement using reference iteration

2016-05-30 Thread Michael Haggerty
Use the reference iterator interface to implement do_for_each_ref(). Delete a bunch of code supporting the old for_each_ref() implementation. And now that do_for_each_ref() is generic code (it is no longer tied to the files backend), move it to refs.c. The implementation is via a new function,

[PATCH 06/13] get_ref_cache(): only create an instance if there is a submodule

2016-05-30 Thread Michael Haggerty
If there is not a nonbare repository where a submodule is supposedly located, then don't instantiate a ref_cache for it. The analogous check can be removed from resolve_gitlink_ref(). Signed-off-by: Michael Haggerty --- This doesn't actually reduce the number of ref_cache

[PATCH 08/13] ref_resolves_to_object(): new function

2016-05-30 Thread Michael Haggerty
Extract new function ref_resolves_to_object() from entry_resolves_to_object(). It can be used even if there is no ref_entry at hand. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 33 +++-- 1 file changed, 23 insertions(+), 10

[PATCH 11/13] for_each_reflog(): don't abort for bad references

2016-05-30 Thread Michael Haggerty
If there is a file under "$GIT_DIR/logs" with no corresponding reference, the old code was emitting an error message, aborting the reflog iteration, and returning -1. But * None of the callers was checking the exit value * The callers all want to find all legitimate reflogs (sometimes for the

[PATCH 00/13] Reference iterators

2016-05-30 Thread Michael Haggerty
This patch series implements a new iteration paradigm for iterating over references using iterators. This approach was proposed earlier as an RFC [1]. The justification for this change is laid out in the RFC [1] and in the commit message for patch 09/13 [2]. Please refer to those, as I won't

[PATCH 12/13] dir_iterator: new API for iterating over a directory tree

2016-05-30 Thread Michael Haggerty
The iterator interface is modeled on that for references, though no vtable is necessary because there is (so far?) only one type of dir_iterator. There are obviously a lot of features that could easily be added to this class: * Skip/include directory paths in the iteration * Shallow/deep

[PATCH 13/13] for_each_reflog(): reimplement using iterators

2016-05-30 Thread Michael Haggerty
Allow references with reflogs to be iterated over using a ref_iterator. The latter is implemented as a files_reflog_iterator, which in turn uses dir_iterator to read the "logs" directory. Note that reflog iteration doesn't correctly handle per-worktree reflogs (either before or after this patch).

[PATCH 07/13] entry_resolves_to_object(): rename function from ref_resolves_to_object()

2016-05-30 Thread Michael Haggerty
Free up the old name for a more general purpose. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 142c977..1a46f32 100644 ---

Re: [PATCH] README.md: format CLI commands with code syntax

2016-05-30 Thread Matthieu Moy
Benjamin Dopplinger writes: > CLI commands which are mentioned in the readme are now formatted with > the Markdown code syntax to make the documentation more readable. > > Signed-off-by: Benjamin Dopplinger > --- > README.md | 10 +- > 1