Re: [PATCH v2 32/32] ls-files: use repository object

2017-06-09 Thread Junio C Hamano
Brandon Williams writes: >> -if (read_cache() < 0) >> +if (repo_read_index(the_repository)) > > oops, looks like this should have been: Queued, with this fix-up already applied. It had a bit of conflicts with topics in flight that may added some more globals, so

Re: [PATCH] pathspec: die on empty strings as pathspec

2017-06-09 Thread Junio C Hamano
Emily Xie writes: > diff --git a/t/t3700-add.sh b/t/t3700-add.sh > index f3a4b4a..40a0d2b 100755 > --- a/t/t3700-add.sh > +++ b/t/t3700-add.sh > @@ -331,9 +331,8 @@ test_expect_success 'git add --dry-run --ignore-missing > of non-existing file out > test_i18ncmp

Re: [PATCH] doc: describe git svn init --ignore-refs

2017-06-09 Thread Junio C Hamano
Thanks, will pull.

Re: [PATCHv2 3/5] revision.c: stricter parsing of '--early-output'

2017-06-09 Thread Junio C Hamano
SZEDER Gábor writes: > The parsing of '--early-output' with or without its optional integer > argument allowed bogus options like '--early-output-foobarbaz' to slip > through and be ignored. > > Fix it by parsing '--early-output' in the same way as other options > with an

Re: [PATCH v2 5/8] t1308: relax the test verifying that empty alias values are disallowed

2017-06-09 Thread Junio C Hamano
Johannes Schindelin writes: > We are about to change the way aliases are expanded, to use the early > config machinery. > > This machinery reports errors in a slightly different manner than the > cached config machinery. > > Let's not get hung up by the precise

Re: [PATCH v2 1/2] git-compat-util: add a FREEZ() wrapper around free(ptr); ptr = NULL

2017-06-09 Thread Eric Wong
Junio C Hamano wrote: > Eric Wong writes: > > I don't see the point of a macro wrapper, forcing the user to > > type out the '&' should drive home the point that the pointer > > gets set to NULL. I also find capitalization tiring-to-read > > because all

Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch

2017-06-09 Thread Junio C Hamano
Kaartic Sivaraam writes: >Subject: Re: [PATCH] wt-status.c: Modified status message shown for a >parent-less branch $ git shortlog -20 --no-merges may help learning the preferred style of writing the title. We do not say "[I] did this". Instead we phrase

Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch

2017-06-09 Thread Kaartic Sivaraam
The status message shown for a parent-less branch wasn't so descriptive and was a little confusing. The message has been changed to be more descriptive to users in such a way that it clearly shows the state of the branch / repository. This allows the users to be reminded that they are about to

Re: [BUG?] gitlink without .gitmodules no longer fails recursive clone

2017-06-09 Thread Junio C Hamano
Jeff King writes: > In an ideal world the user do: > > git submodule add git://host/repo.git path > > which adds the gitlink and the .gitmodules entry. But it doesn't seem > unreasonable for somebody unfamiliar with submodules to do: > > git clone git://host/repo.git path >

Re: [PATCH] wildmatch test: cover a blind spot in "/" matching

2017-06-09 Thread Junio C Hamano
Junio C Hamano writes: > Ævar Arnfjörð Bjarmason writes: > >> Add a test which covers a blindspot in how these tests should assert >> that negated character classes are allowed or not allowed to match "/" >> in certain circumstances. > > Please make this a

Re: [PATCH] wildmatch test: cover a blind spot in "/" matching

2017-06-09 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Add a test which covers a blindspot in how these tests should assert > that negated character classes are allowed or not allowed to match "/" > in certain circumstances. Please make this a bit more explicit, something like A negated

[PATCH] wt-status.c: Modified status message shown for a parent-less branch

2017-06-09 Thread Kaartic Sivaraam
The status message shown for a paren-less branch wasn't so descriptive and was a little confusing. The message has been changed to be more descriptive to users in such a way that it clearly shows the state of the branch / repository. This allows the users to be reminded that they are about to

Re: How to git push mirror local refs only?

2017-06-09 Thread Junio C Hamano
Robert Dailey writes: > So I want to update my remote fork with all my local branches. > Normally I'd do this: > > $ git push --mirror fork > > However this will also push everything under `refs/remotes` which I do > not want. And it fails if I specify a refspec

Re: [PATCH v1] Configure Git contribution guidelines for github.com

2017-06-09 Thread Junio C Hamano
Jonathan Nieder writes: > Lars Schneider wrote: > >> Many open source projects use github.com for their contribution process. >> Although we mirror the Git core repository to github.com [1] we do not >> use any other github.com service. This is unknown/unexpected to a >>

Re: [PATCH v1] Configure Git contribution guidelines for github.com

2017-06-09 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > On Fri, Jun 9, 2017 at 4:21 PM, Lars Schneider > wrote: > ... >> I am perfectly aware that adding a ".github" directory in the Git core >> tree is ugly. However, I believe the benefits ("well informed new >>

Re: [PATCH v2 1/2] git-compat-util: add a FREEZ() wrapper around free(ptr); ptr = NULL

2017-06-09 Thread Junio C Hamano
Eric Wong writes: > Jonathan Nieder wrote: >> Hi, >> >> Ævar Arnfjörð Bjarmason wrote: >> >> > Add a FREEZ() wrapper marco for the common pattern of freeing a >> > pointer and assigning NULL to it right afterwards. >> >> I'm conflicted. On one hand it

Re: [PATCH 8/9] Use the early config machinery to expand aliases

2017-06-09 Thread Junio C Hamano
Johannes Schindelin writes: > -static char *orig_env[4]; > -static int save_restore_env_balance; > - > -static void save_env_before_alias(void) > -{ > -... > -} > - > -static void restore_env(int external_alias) > -{ > -... > -} > > static void

Re: [PATCH 5/9] t1308: relax the test verifying that empty alias values are disallowed

2017-06-09 Thread Junio C Hamano
Johannes Schindelin writes: > We are about to change the way aliases are expanded, to use the early > config machinery. > > This machinery reports errors in a slightly different manner than the > cached config machinery. > > Let's not get hung up by the precise

Re: [PATCH v2 00/32] repository object

2017-06-09 Thread Jonathan Tan
On Thu, 8 Jun 2017 16:40:28 -0700 Brandon Williams wrote: > When I sent out my RFC series there seemed to be a lot of interest but I > haven't seen many people jump to review this series. Despite lack of review I > wanted to get out another version which includes some

Re: [PATCH v2 1/2] git-compat-util: add a FREEZ() wrapper around free(ptr); ptr = NULL

2017-06-09 Thread Eric Wong
Jonathan Nieder wrote: > Hi, > > Ævar Arnfjörð Bjarmason wrote: > > > Add a FREEZ() wrapper marco for the common pattern of freeing a > > pointer and assigning NULL to it right afterwards. > > I'm conflicted. On one hand it makes code more concise and makes it > easier for

Re: [BUG?] gitlink without .gitmodules no longer fails recursive clone

2017-06-09 Thread Jeff King
On Tue, Jun 06, 2017 at 02:39:14PM -0400, Jeff King wrote: > > Just for some background on the new behavior and how this functionality > > changed: My series changed how 'submodule init' behaved if you have > > 'submodule.active' set. Once set (like how clone --recurse does now) > > when not

Re: [PATCH v2 1/2] git-compat-util: add a FREEZ() wrapper around free(ptr); ptr = NULL

2017-06-09 Thread Jonathan Nieder
Hi, Ævar Arnfjörð Bjarmason wrote: > Add a FREEZ() wrapper marco for the common pattern of freeing a > pointer and assigning NULL to it right afterwards. I'm conflicted. On one hand it makes code more concise and makes it easier for people to remember to assign NULL after freeing a variable.

[PATCH v2 2/2] *.[ch] refactoring: make use of the FREEZ() macro

2017-06-09 Thread Ævar Arnfjörð Bjarmason
Replace occurrences of `free(ptr); ptr = NULL` with `FREEZ(ptr)`. This introduces no functional changes, but reduces the line count and establishes this pattern as a common idiom with a wrapper macro. Signed-off-by: Ævar Arnfjörð Bjarmason --- alias.c | 6

[PATCH v2 1/2] git-compat-util: add a FREEZ() wrapper around free(ptr); ptr = NULL

2017-06-09 Thread Ævar Arnfjörð Bjarmason
Add a FREEZ() wrapper marco for the common pattern of freeing a pointer and assigning NULL to it right afterwards. The implementation is similar to the (currently unused) XDL_PTRFREE macro in xdiff/xmacros.h added in commit 3443546f6e ("Use a *real* built-in diff generator", 2006-03-24). The only

[PATCH v2 0/2] Add a FREEZ() wrapper macro

2017-06-09 Thread Ævar Arnfjörð Bjarmason
See <20170609085346.19974-1-ava...@gmail.com> (https://public-inbox.org/git/20170609085346.19974-1-ava...@gmail.com/) for v1. Changes: * Now called FREEZ() instead of freez(). * Documented the caveat of giving it ptr++ both in the commit message and in a comment. * Moved the definition to

[RFC PATCH 2/4] sha1_file: extract type and size from object_info

2017-06-09 Thread Jonathan Tan
This is patch 1 of 2 to consolidate all storage-agnostic object information functions. In sha1_file.c, there are a few functions that provide information on an object regardless of its storage (cached, loose, or packed). Looking through all non-static functions in sha1_file.c that take in an

[RFC PATCH 3/4] sha1_file: consolidate storage-agnostic object fns

2017-06-09 Thread Jonathan Tan
This is patch 2 of 2 to consolidate all storage-agnostic object information functions. In sha1_file.c, there are a few functions that provide information on an object regardless of its storage (cached, loose, or packed). Looking through all non-static functions in sha1_file.c that take in an

[RFC PATCH 4/4] sha1_file, fsck: add missing blob support

2017-06-09 Thread Jonathan Tan
Currently, Git does not support repos with very large numbers of blobs or repos that wish to minimize manipulation of certain blobs (for example, because they are very large) very well, even if the user operates mostly on part of the repo, because Git is designed on the assumption that every blob

[RFC PATCH 0/4] Improvements to sha1_file

2017-06-09 Thread Jonathan Tan
I was investigating how to adapt my existing patch for missing blob support [1] to consult a manifest of missing blobs, and found it difficult to further modify sha1_file.c without doing some further refactoring. So here are some patches to do that. I think patch 1 is an independently good change

[RFC PATCH 1/4] sha1_file: teach packed_object_info about typename

2017-06-09 Thread Jonathan Tan
In commit 46f0344 ("sha1_file: support reading from a loose object of unknown type", 2015-05-06), "struct object_info" gained a "typename" field that could represent a type name from a loose object file, whether valid or invalid, as opposed to the existing "typep" which could only represent valid

[PATCHv2 5/5] revision.c: use skip_prefix() in handle_revision_pseudo_opt()

2017-06-09 Thread SZEDER Gábor
Instead of starts_with() and a bunch of magic numbers. Signed-off-by: SZEDER Gábor --- revision.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/revision.c b/revision.c index c99c47c50..12a44189e 100644 --- a/revision.c +++

[PATCHv2 4/5] revision.c: use skip_prefix() in handle_revision_opt()

2017-06-09 Thread SZEDER Gábor
Instead of starts_with() and a bunch of magic numbers. Signed-off-by: SZEDER Gábor --- revision.c | 48 +++- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/revision.c b/revision.c index 68531ff5d..c99c47c50

[PATCHv2 3/5] revision.c: stricter parsing of '--early-output'

2017-06-09 Thread SZEDER Gábor
The parsing of '--early-output' with or without its optional integer argument allowed bogus options like '--early-output-foobarbaz' to slip through and be ignored. Fix it by parsing '--early-output' in the same way as other options with an optional argument are parsed. Furthermore, use

Re: [PATCH 2/3] revision.c: use skip_prefix() in handle_revision_opt()

2017-06-09 Thread SZEDER Gábor
On Fri, Jun 2, 2017 at 10:11 PM, Jeff King wrote: > On Fri, Jun 02, 2017 at 09:10:09PM +0200, SZEDER Gábor wrote: > >> @@ -1785,15 +1785,15 @@ static int handle_revision_opt(struct rev_info >> *revs, int argc, const char **arg >> } else if (!strcmp(arg,

[PATCHv2 2/5] revision.c: stricter parsing of '--no-{min,max}-parents'

2017-06-09 Thread SZEDER Gábor
These two options are parsed using starts_with(), allowing things like 'git log --no-min-parents-foobarbaz' to succeed. Use strcmp() instead. Signed-off-by: SZEDER Gábor --- revision.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/revision.c

[PATCHv2 1/5] revision.h: turn rev_info.early_output back into an unsigned int

2017-06-09 Thread SZEDER Gábor
rev_info.early_output started out as an unsigned int in cdcefbc97 (Add "--early-output" log flag for interactive GUI use, 2007-11-03), but later it was turned into a single bit in a bit field in cc243c3ce (show: --ignore-missing, 2011-05-18) without explanation, though its users still expect it to

Re: [PATCH 3/9] help: use early config when autocorrecting aliases

2017-06-09 Thread Junio C Hamano
Johannes Schindelin writes: > This is slightly less performant than the previous way, as the early > config is used *twice*: once to see whether the command refers to an > alias, and then to see what aliases are most similar. However, this is > hardly a

Re: [PATCH v1] Configure Git contribution guidelines for github.com

2017-06-09 Thread Jonathan Nieder
Hi, Some mostly nitpicky initial thoughts. Thanks for writing this. Lars Schneider wrote: > Many open source projects use github.com for their contribution process. > Although we mirror the Git core repository to github.com [1] we do not > use any other github.com service. This is

Re: [PATCH 2/9] config: report correct line number upon error

2017-06-09 Thread Junio C Hamano
Johannes Schindelin writes: > When get_value() parses a key/value pair, it is possible that the line > number is decreased (because the \n has been consumed already) before the > key/value pair is passed to the callback function, to allow for the > correct line to be

Re: [PATCH] pathspec: die on empty strings as pathspec

2017-06-09 Thread Brandon Williams
On 06/06, Emily Xie wrote: > An empty string as a pathspec element matches all paths. A buggy > script, however, could accidentally assign an empty string to a > variable that then gets passed to a Git command invocation, e.g.: > > path=... compute a path to be removed in $path ... >

Re: [PATCH 2/3] rebase: Add tests for console output

2017-06-09 Thread Junio C Hamano
Phillip Wood writes: > I'm confused by this as my script does not use the escape sequence "\r" > out of portability concerns. It has a literal carriage return as you get > from typing Ctrl-Q Ctrl-M in emacs or Ctrl-V Ctrl-M in bash ... I think the worry is that some

Re: send-email: Net::SMTP::SSL failure

2017-06-09 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > I have not looked deeply at this, but the error you're getting means > "we tried to load it before and failed, and here you are trying > again". > > This is almost definitely due to this line in git-send-email: > > if (eval { require

Re: [PATCH] pathspec: die on empty strings as pathspec

2017-06-09 Thread Junio C Hamano
Emily Xie writes: > An empty string as a pathspec element matches all paths. A buggy > script, however, could accidentally assign an empty string to a > variable that then gets passed to a Git command invocation, e.g.: > > path=... compute a path to be removed in $path

Re: [PATCH v1] Configure Git contribution guidelines for github.com

2017-06-09 Thread Lars Schneider
> On 09 Jun 2017, at 18:18, Ævar Arnfjörð Bjarmason wrote: > > On Fri, Jun 9, 2017 at 4:21 PM, Lars Schneider > wrote: >> Many open source projects use github.com for their contribution process. >> Although we mirror the Git core repository to

Re: [PATCH] wildmatch test: cover a blind spot in "/" matching

2017-06-09 Thread Ævar Arnfjörð Bjarmason
On Sat, May 27, 2017 at 11:13 AM, Ævar Arnfjörð Bjarmason wrote: > Add a test which covers a blindspot in how these tests should assert > that negated character classes are allowed or not allowed to match "/" > in certain circumstances. Junio: I didn't CC you on this, because I

Re: [PATCH v1] Configure Git contribution guidelines for github.com

2017-06-09 Thread Ævar Arnfjörð Bjarmason
On Fri, Jun 9, 2017 at 4:21 PM, Lars Schneider wrote: > Many open source projects use github.com for their contribution process. > Although we mirror the Git core repository to github.com [1] we do not > use any other github.com service. This is unknown/unexpected to a >

How to git push mirror local refs only?

2017-06-09 Thread Robert Dailey
So I want to update my remote fork with all my local branches. Normally I'd do this: $ git push --mirror fork However this will also push everything under `refs/remotes` which I do not want. And it fails if I specify a refspec parameter with --mirror. Is there a way to achieve this through one

Re: [PATCH 0/2] Add a freez() wrapper

2017-06-09 Thread Brandon Williams
On 06/09, Ævar Arnfjörð Bjarmason wrote: > On Fri, Jun 9, 2017 at 1:40 AM, Brandon Williams wrote: > > Introduce the repository object 'struct repository' which can be used to > > hold all state pertaining to a git repository. > > [...] > > +static void repo_clear_env(struct

Re: [PATCH 2/2] *.[ch] refactoring: make use of the freez() wrapper

2017-06-09 Thread Brandon Williams
On 06/09, Ævar Arnfjörð Bjarmason wrote: > On Fri, Jun 9, 2017 at 12:12 PM, Martin Ågren wrote: > > On 9 June 2017 at 10:53, Ævar Arnfjörð Bjarmason wrote: > >> Replace occurrences of `free(p); p = NULL` with `freez(p)`. This > >> introduces no

Re: [PATCH 2/2] add [--] to usage of filter-branch

2017-06-09 Thread Andreas Heiduk
Am 09.06.2017 um 15:14 schrieb Junio C Hamano: > Andreas Heiduk writes: > >> Am 03.06.2017 um 12:17 schrieb Andreas Heiduk: >>> Signed-off-by: Andreas Heiduk >>> --- >>> Documentation/git-filter-branch.txt | 3 ++- >>> git-filter-branch.sh

[PATCH v1] Configure Git contribution guidelines for github.com

2017-06-09 Thread Lars Schneider
Many open source projects use github.com for their contribution process. Although we mirror the Git core repository to github.com [1] we do not use any other github.com service. This is unknown/unexpected to a number of (potential) contributors and consequently they create Pull Requests against

Re: [PATCH] docs: suggest "Helped-by" rather than "Thanks-to"

2017-06-09 Thread Junio C Hamano
Adam Dinwoodie writes: >> Thanks for an interesting list. Your replacing (totally >> unconventional) Thanks-to with more common Helped-by is certainly an >> improvement, but I wonder if we should encourage people to be >> "original" in this area by having that "You can also

Re: [PATCH 2/2] add [--] to usage of filter-branch

2017-06-09 Thread Junio C Hamano
Andreas Heiduk writes: > Am 03.06.2017 um 12:17 schrieb Andreas Heiduk: >> Signed-off-by: Andreas Heiduk >> --- >> Documentation/git-filter-branch.txt | 3 ++- >> git-filter-branch.sh| 2 +- >> 2 files changed, 3 insertions(+), 2

Re: [PATCH 1/2] add setup step to filter-branch

2017-06-09 Thread Junio C Hamano
Jeff King writes: > I have a feeling that if we were ever to rewrite filter-branch, it would > probably be worth allowing people to write snippets in a better language > (possibly even a domain-specific language). I'm sure that most of the > program being written in shell doesn't

Re: [PATCH v4 0/8] PCRE v2, PCRE v1 JIT, log -P & fixes

2017-06-09 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >>> 'ab/pcre-v2' was marked for 'next' in "What's cookin" a few issues >>> ago, but I'll keep it in 'pu' to wait for the above---please give me >>> a go ahead when we all are happy with the topic. I expect to be >>> offline in the later part of

Re: [BUG] Failed to sign commit

2017-06-09 Thread pedro rijo
as much cliché as it may seem, GPG was with some strange behaviour, killing the agent and starting again make it work with no problems Thanks for the help 2017-06-07 21:41 GMT+01:00 Bryan Turner : >> $ GIT_TRACE=1 git commit --allow-empty -v -m "lol" >> 11:37:24.594795

[no subject]

2017-06-09 Thread Mrs Alice Walton
I have a charity proposal for you

Re: [PATCH 1/2] git-compat-util: add a freez() wrapper around free(x); x = NULL

2017-06-09 Thread Christian Couder
On Fri, Jun 9, 2017 at 10:53 AM, Ævar Arnfjörð Bjarmason wrote: > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -787,6 +787,7 @@ extern char *xstrdup(const char *str); > extern void *xmalloc(size_t size); > extern void *xmallocz(size_t size); > extern void

Re: "There are too many unreachable loose objects" - why don't we run 'git prune' automatically?

2017-06-09 Thread Lars Schneider
> On 09 Jun 2017, at 07:27, Jeff King wrote: > > On Thu, Jun 08, 2017 at 02:45:48PM +0200, Lars Schneider wrote: > >> I recently ran into "There are too many unreachable loose objects; run >> 'git prune' to remove them." after a "Auto packing the repository in >> background

Re: There are too many unreachable loose objects

2017-06-09 Thread Lars Schneider
> On 09 Jun 2017, at 07:36, Jeff King wrote: > > On Thu, Jun 08, 2017 at 02:52:42PM +0200, Lars Schneider wrote: > It may be that it's the server side that needs to git-prune, and not your local side? I'm not really certain but you're doing a push which talks to a

Re: [PATCH 2/2] *.[ch] refactoring: make use of the freez() wrapper

2017-06-09 Thread Ævar Arnfjörð Bjarmason
On Fri, Jun 9, 2017 at 12:12 PM, Martin Ågren wrote: > On 9 June 2017 at 10:53, Ævar Arnfjörð Bjarmason wrote: >> Replace occurrences of `free(p); p = NULL` with `freez(p)`. This >> introduces no functional changes, but cuts the number of lines spent >>

Re: [PATCH 2/2] *.[ch] refactoring: make use of the freez() wrapper

2017-06-09 Thread Martin Ågren
On 9 June 2017 at 10:53, Ævar Arnfjörð Bjarmason wrote: > Replace occurrences of `free(p); p = NULL` with `freez(p)`. This > introduces no functional changes, but cuts the number of lines spent > on this cleanup in half. It's even better than that. ;) > 48 files changed, 97

[PATCH 2/2] *.[ch] refactoring: make use of the freez() wrapper

2017-06-09 Thread Ævar Arnfjörð Bjarmason
Replace occurrences of `free(p); p = NULL` with `freez(p)`. This introduces no functional changes, but cuts the number of lines spent on this cleanup in half. Signed-off-by: Ævar Arnfjörð Bjarmason --- alias.c | 6 ++ apply.c | 3 +--

[PATCH 1/2] git-compat-util: add a freez() wrapper around free(x); x = NULL

2017-06-09 Thread Ævar Arnfjörð Bjarmason
Add a freez() wrapper for the common pattern of freeing a pointer and assigning NULL to it right afterwards. The implementation is the same as the (currently unused) XDL_PTRFREE macro in xdiff/xmacros.h added in commit 3443546f6e ("Use a *real* built-in diff generator", 2006-03-24).

[PATCH 0/2] Add a freez() wrapper

2017-06-09 Thread Ævar Arnfjörð Bjarmason
On Fri, Jun 9, 2017 at 1:40 AM, Brandon Williams wrote: > Introduce the repository object 'struct repository' which can be used to > hold all state pertaining to a git repository. > [...] > +static void repo_clear_env(struct repository *repo) > +{ > + free(repo->gitdir);

Re: git stash --include-untracked possible destructive behavior

2017-06-09 Thread Marc Strapetz
On 09.06.2017 00:39, Joel Teichroeb wrote: Looks like that series was merged last week, fixing this issue. Marc, the fix will probably be in git 2.14. Thanks, I can confirm that with current master "git clean" as well as "git stash" are working properly now (tested on Linux). I'm looking