Re: [RFC PATCH] remote: add --fetch option to git remote set-url

2018-10-28 Thread Junio C Hamano
Denton Liu writes: > This adds the --fetch option to `git remote set-url` such that when > executed we move the remote.*.url to remote.*.pushurl and set > remote.*.url to the given url argument. > I suspect this is a horrible idea from end-user's point of view. "set-url --push" is used to SET

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Nickolai Belakovski
On Sun, Oct 28, 2018 at 9:01 PM Eric Sunshine wrote: > > On Sun, Oct 28, 2018 at 9:11 PM Nickolai Belakovski > wrote: > > I would also suggest renaming is_worktree_locked to > > worktree_lock_reason, the former makes me think the function is > > returning a boolean, whereas the latter more

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Nickolai Belakovski
On Sun, Oct 28, 2018 at 8:52 PM Junio C Hamano wrote: > > > If the field "reason" should always be populated, there is *no* > reason why we need the "valid" boolean. They work as a pair to > realize lazy population of rarely used field. The lazy evaluation > technique is used as an optimization

Re: [PATCH v3 7/8] push: add DWYM support for "git push refs/remotes/...:"

2018-10-28 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Add DWYM support for pushing a ref in refs/remotes/* when the I think most people call it do-what-*I*-mean, not do-what-you-mean. > ref is unqualified. Now instead of erroring out we support e.g.: > > $ ./git-push avar

Re: [PATCH v3 6/8] push: test that doesn't DWYM if is unqualified

2018-10-28 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Add a test asserting that "git push origin :" where is > a branch, tag, tree or blob in refs/remotes/* doesn't DWYM when > is unqualified. This has never worked, but there's been no test for > this behavior. "has never worked" sounded as if there is a

Re: [PATCH v3 5/8] push: add an advice on unqualified push

2018-10-28 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > + if (!advice_push_unqualified_ref_name) > + return; > + > + if (get_oid(matched_src_name, )) > + BUG("'%s' is not a valid object, " > + "match_explicit_lhs() should catch this!", > +

Re: [PATCH v3 3/8] push: improve the error shown on unqualified push

2018-10-28 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Improve the error message added in f8aae12034 ("push: allow > unqualified dest refspecs to DWIM", 2008-04-23), which before this > change looks like this: > > $ git push avar v2.19.0^{commit}:newbranch -n > error: unable to push to unqualified

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-28 Thread Junio C Hamano
Anders Waldenborg writes: > This new format placeholder allows displaying only a single > trailer. The formatting done is similar to what is done for > --decorate/%d using parentheses and comma separation. > > It's intended use is for things like ticket references in trailers. > > So with a

Re: [PATCH 2/2] push: add an advice on unqualified push

2018-10-28 Thread Junio C Hamano
Junio C Hamano writes: > To put it another way, I would think both of these two have at most > the same probability that the push wants to go to a local branch: > > git push refs/remotes/foo:foo > git push :foo > > and I would further say that the former is less likely than the >

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Eric Sunshine
On Sun, Oct 28, 2018 at 9:11 PM Nickolai Belakovski wrote: > On Sun, Oct 28, 2018 at 4:03 PM Eric Sunshine wrote: > > Aside from that, it doesn't seem like worktree needs any changes for > > the ref-filter atom you have in mind. (Don't interpret this > > observation as me being averse to changes

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Junio C Hamano
Nickolai Belakovski writes: > This is an improvement because it fixes an issue in which the fields > lock_reason and lock_reason_valid of the worktree struct were not > being populated. If the field "reason" should always be populated, there is *no* reason why we need the "valid" boolean. They

Re: [PATCH] alias: detect loops in mixed execution mode

2018-10-28 Thread Junio C Hamano
Jeff King writes: > Hmph. So I was speaking before purely hypothetically, but now that your > patch is in 'next', it is part of my daily build. And indeed, I hit a > false positive within 5 minutes of building it. ;) Sounds like somebody is having not-so-fun-a-time having "I told you so"

Re: [PATCH 00/10] Resending sb/submodule-recursive-fetch-gets-the-tip

2018-10-28 Thread Junio C Hamano
Stefan Beller writes: > Thanks Jonathan for your thoughtful comments, > here is the product of the discussion: Can you use v$n in the subject (if these rerolls are meant for application and not primarily for discussion, that is)? It quickly gets confusing to see many messages with the same

Re: [PATCH] sequencer: clarify intention to break out of loop

2018-10-28 Thread Junio C Hamano
Eric Sunshine writes: >> diff --git a/sequencer.c b/sequencer.c >> @@ -2849,10 +2849,14 @@ static int do_reset(const char *name, int len, >> struct replay_opts *opts) >> /* Determine the length of the label */ >> + for (i = 0; i < len; i++) { >> +

Re: t7405.17 breakage vanishes with GETTEXT_POISON=1

2018-10-28 Thread Junio C Hamano
SZEDER Gábor writes: > The test in question runs > > test_i18ngrep ! "refusing to lose untracked file at" err > > which fails in normal test runs, because 'grep' does find the > undesired string; that's the known breakage. Under GETTEXT_POISION, > however, 'test_i18ngrep' always succeeds

Re: [PATCH] update git-http-backend doc for lighttpd

2018-10-28 Thread Junio C Hamano
Glenn Strauss writes: > use "GIT_HTTP_EXPORT_ALL" => "1" with a value for best compatiblity. > lighttpd 1.4.51 setenv.add-environment does add vars with empty value. > lighttpd setenv.set-environment does, but was only introduced in 1.4.46 > > git-http-backend may be found at

Re: [PATCH v2 00/16] sequencer: refactor functions working on a todo_list

2018-10-28 Thread Junio C Hamano
Alban Gruin writes: > At the center of the "interactive" part of the interactive rebase lies > the todo list. When the user starts an interactive rebase, a todo list > is generated, presented to the user (who then edits it using a text > editor), read back, and then is checked and processed

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-28 Thread Junio C Hamano
Duy Nguyen writes: >> Nice analyzes. >> I have one question here: >> If the user specifies '**' and nothing is found, >> would it be better to die() with a useful message >> instead of silently correcting it ? > > Consider the main use case of wildmatch, .gitignore patterns, dying > would be

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-28 Thread Junio C Hamano
Jeff King writes: > Cases like this are kind of weird. I'd expect to see wait_all() return > immediately when !HAVE_THREADS. But we don't need to, because later we > do this: > >> -if (num_threads) >> +if (HAVE_THREADS && num_threads) >> hit |= wait_all(); > > Which I think

Re: [PATCH 00/78] nd/config-split reroll

2018-10-28 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Compared to the version on 'pu', this one moves all the config files > to Documentation/config/ directory. imap.* is also added back in > config.txt (curently only documented in git-imap-send.txt) The other biggie seems to be http.* that are now in a separate

Re: [PATCH 3/3] commit-reach.h: add missing declarations (hdr-check)

2018-10-28 Thread Junio C Hamano
Ramsay Jones writes: > ... >24 clear_contains_cache > $ > > you will find 24 copies of the commit-slab routines for the contains_cache. > Of course, when you enable optimizations again, these duplicate static > functions (mostly) disappear. Compiling with gcc at -O2, leaves two static

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Nickolai Belakovski
On Sun, Oct 28, 2018 at 4:03 PM Eric Sunshine wrote: > > On Sun, Oct 28, 2018 at 5:55 PM Nickolai Belakovski > > wrote: This was meant to be a reply to > >

Re: [PATCH 2/2] push: add an advice on unqualified push

2018-10-28 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > I was going to submit an update to this, as an additional improvement > can anyone think of a reason not to always infer that we'd like a new > branch if the LHS of the refspec starts with refs/remotes/* ? Depends on what purpose the remote you are pushing into

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-10-28 Thread Junio C Hamano
Jeff King writes: > Of course any cache raises questions of cache invalidation, but I think > we've already dealt with that for this case. When we use > OBJECT_INFO_QUICK, that is a sign that we want to make this kind of > accuracy/speed tradeoff (which does a similar caching thing with >

Re: [PATCH v4 10/12] Add a base implementation of SHA-256 support

2018-10-28 Thread Junio C Hamano
"brian m. carlson" writes: >> > + >> > +#include "git-compat-util.h" >> >> this shouldn't be needed and might be discouraged as per the >> instructions in Documentation/CodingGuidelines > > This may not strictly be needed, but removing it makes the header no > longer self-contained, which blows

Re: [PATCH v2] list-objects.c: don't segfault for missing cmdline objects

2018-10-28 Thread Junio C Hamano
Matthew DeVore writes: > When a command is invoked with both --exclude-promisor-objects, > --objects-edge-aggressive, and a missing object on the command line, > the rev_info.cmdline array could get a NULL pointer for the value of > an 'item' field. Prevent dereferencing of a NULL pointer in

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Eric Sunshine
On Sun, Oct 28, 2018 at 5:55 PM Nickolai Belakovski > wrote: This was meant to be a reply to > https://public-inbox.org/git/cac05386f1x7tspr6kgkulwewsmdiq4vktf5rxahvzpkwbmx...@mail.gmail.com/T/#m8898c8f7c68e1ea234aca21cb2d7776b375c6f51, > please look there for some more context. I think it both

[PATCH 2/4] pack-objects tests: don't leave test .git corrupt at end

2018-10-28 Thread Ævar Arnfjörð Bjarmason
Change the pack-objects tests to not leave their .git directory corrupt and the end. In 2fca19fbb5 ("fix multiple issues with t5300", 2010-02-03) a comment was added warning against adding any subsequent tests, but since 4614043c8f ("index-pack: use streaming interface for collision test on large

[PATCH 4/4] index-pack: add ability to disable SHA-1 collision check

2018-10-28 Thread Ævar Arnfjörð Bjarmason
Add a new core.checkCollisions setting. On by default, it can be set to 'false' to disable the check for existing objects in sha1_object(). As noted in the documentation being added here this is done out of paranoia about future SHA-1 collisions and as a canary (redundant to "git fsck") for local

[PATCH 0/4] index-pack: optionally turn off SHA-1 collision checking

2018-10-28 Thread Ævar Arnfjörð Bjarmason
This patch series implements what I suggested in https://public-inbox.org/git/87lg6jljmf@evledraar.gmail.com/ It's not a replacement for what Geert Jansen's RFC in https://public-inbox.org/git/ed25e182-c296-4d08-8170-340567d89...@amazon.com/ does, which was to turn this off entirely on

[PATCH 3/4] index-pack tests: don't leave test repo dirty at end

2018-10-28 Thread Ævar Arnfjörð Bjarmason
Change a test added in 51054177b3 ("index-pack: detect local corruption in collision check", 2017-04-01) so that the repository isn't left dirty at the end. Due to the caveats explained in 720dae5a19 ("config doc: elaborate on fetch.fsckObjects security", 2018-07-27) even a "fetch" that fails

[PATCH 1/4] pack-objects test: modernize style

2018-10-28 Thread Ævar Arnfjörð Bjarmason
Modernize the quoting and indentation style of two tests added in 8685da4256 ("don't ever allow SHA1 collisions to exist by fetching a pack", 2007-03-20), and of a subsequent one added in 4614043c8f ("index-pack: use streaming interface for collision test on large blobs", 2012-05-24) which had

Re: [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-28 Thread Nickolai Belakovski
This was meant to be a reply to https://public-inbox.org/git/cac05386f1x7tspr6kgkulwewsmdiq4vktf5rxahvzpkwbmx...@mail.gmail.com/T/#m8898c8f7c68e1ea234aca21cb2d7776b375c6f51, please look there for some more context. I think it both did and didn't get listed as a reply? In my mailbox I see two

Re: [PATCH] sequencer: clarify intention to break out of loop

2018-10-28 Thread Martin Ågren
On Sun, 28 Oct 2018 at 20:01, Eric Sunshine wrote: > > On Sun, Oct 28, 2018 at 11:32 AM Martin Ågren wrote: > > [...] > > Let's be explicit about breaking out of the loop. This helps the > > compiler grok our intention. As a bonus, it might make it (even) more > > obvious to human readers that

Re: [PATCH] sequencer: clarify intention to break out of loop

2018-10-28 Thread Eric Sunshine
On Sun, Oct 28, 2018 at 11:32 AM Martin Ågren wrote: > [...] > Let's be explicit about breaking out of the loop. This helps the > compiler grok our intention. As a bonus, it might make it (even) more > obvious to human readers that the loop stops at the first space. This did come up in

Hello Dear

2018-10-28 Thread Tracy William
Hello Dear, how are you today,I hope you are doing great. It is my great pleasure to contact you,I want to make a new and special friend,I hope you don't mind. My name is Tracy William from the United States, Am a french and English nationality. I will give you pictures and more details

Re: [PATCH v4 10/12] Add a base implementation of SHA-256 support

2018-10-28 Thread brian m. carlson
On Wed, Oct 24, 2018 at 08:02:55PM -0700, Carlo Arenas wrote: > On Wed, Oct 24, 2018 at 7:41 PM brian m. carlson > wrote: > > diff --git a/sha256/block/sha256.h b/sha256/block/sha256.h > > new file mode 100644 > > index 00..38f02f7e6c > > --- /dev/null > > +++ b/sha256/block/sha256.h > >

Re: [PATCH 0/3] some more hdr-check clean headers

2018-10-28 Thread brian m. carlson
On Sat, Oct 27, 2018 at 02:47:47AM +0100, Ramsay Jones wrote: > > I have some changes to the hdr-check Makefile target in the works, but > these clean-ups don't have to be held up by those changes. > > The 'fetch-object.h' patch is the same one I sent separately last time, > since it only

[PATCH] sequencer: clarify intention to break out of loop

2018-10-28 Thread Martin Ågren
When we find a space, we set `len = i`, which gives us the answer we are looking for, but which also breaks out of the loop through these steps: 1. `len = i` 2. `i = i + 1` 3. Is `i < len`? No, so break out. Since `i` is signed, step 2 is undefined if `i` has the value `INT_MAX`. It

[PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-28 Thread Anders Waldenborg
This new format placeholder allows displaying only a single trailer. The formatting done is similar to what is done for --decorate/%d using parentheses and comma separation. It's intended use is for things like ticket references in trailers. So with a commit with a message like: > Some good

Re: t7405.17 breakage vanishes with GETTEXT_POISON=1

2018-10-28 Thread SZEDER Gábor
On Sun, Oct 28, 2018 at 06:41:06AM +0100, Duy Nguyen wrote: > Something fishy is going on but I don't think I'll spend time hunting > it down so I post here in case somebody else is interested. It might > also indicate a problem with poison gettext, not the test case too. I haven't actually run

Re: [PATCH] l10n: vi.po: fix typo in pack-objects

2018-10-28 Thread Duy Nguyen
I'm not sure if Junio still takes .po patches or only Jiang Xin does. I CC Jiang here just in case. On Thu, Oct 25, 2018 at 3:05 AM Minh Nguyen wrote: > > --- > po/vi.po | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/po/vi.po b/po/vi.po > index bc79319b6..e646825ed

[PATCH 02/12] alias.c: mark split_cmdline_strerror() strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
This function can be part of translated messages. To make sure we don't have a sentence with mixed languages, mark the strings for translation, but only use translated strings in places we know we will output translated strings. Signed-off-by: Nguyễn Thái Ngọc Duy --- alias.c | 4 ++--

[PATCH 03/12] archive.c: mark more strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- archive.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archive.c b/archive.c index 9d16b7fadf..757519a9d6 100644 --- a/archive.c +++ b/archive.c @@ -385,12 +385,12 @@ static void parse_treeish_arg(const char **argv,

[PATCH 05/12] read-cache.c: mark more strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
There are a couple other improvements on these strings as well: - add missing colon (as separator) - quote paths - provide more information on error messages - keep first word in lowercase - some die() become BUG() Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c| 63

[PATCH 00/12] Mark more strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Not much to write here. I make a note whenever I see unstranslated strings during review and this is the result. There are some more code changes than just adding _() though, e.g. 10/12. Nguyễn Thái Ngọc Duy (12): git.c: mark more strings for translation alias.c: mark split_cmdline_strerror()

[PATCH 04/12] attr.c: mark more string for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 60d284796d..4ebc169abe 100644 --- a/attr.c +++ b/attr.c @@ -372,7 +372,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,

[PATCH 01/12] git.c: mark more strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/git.c b/git.c index adac132956..1ad565c5c8 100644 --- a/git.c +++ b/git.c @@ -338,27 +338,27 @@ static int handle_alias(int *argcp, const char

[PATCH 11/12] parse-options.c: mark more strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options.c | 18 +- t/t0040-parse-options.sh | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/parse-options.c b/parse-options.c index 0bf817193d..949aac287f 100644 --- a/parse-options.c +++

[PATCH 12/12] fsck: mark strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fsck.c | 113 - t/t1410-reflog.sh | 6 +- t/t1450-fsck.sh| 50 t/t6050-replace.sh | 4 +- t/t7415-submodule-names.sh | 6 +- 5 files changed, 94

[PATCH 06/12] read-cache.c: add missing colon separators

2018-10-28 Thread Nguyễn Thái Ngọc Duy
typechange_fmt and added_fmt should have a colon before "needs update". Align the statements to make it easier to read and see. Also drop the unnecessary (). Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH 07/12] reflog: mark strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reflog.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index b5941c1ff3..33cb20b7d8 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -13,11 +13,15

[PATCH 10/12] parse-options: replace opterror() with optname()

2018-10-28 Thread Nguyễn Thái Ngọc Duy
There are a few issues with opterror() - it tries to assemble an English sentence from pieces. This is not great for translators because we give them pieces instead of a full sentence. - It's a wrapper around error() and needs some hack to let the compiler know it always returns -1. -

[PATCH 08/12] remote.c: mark messages for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- remote.c | 49 + 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/remote.c b/remote.c index 81f4f01b00..11b33d1625 100644 --- a/remote.c +++ b/remote.c @@ -359,7 +359,7 @@ static int

[PATCH 09/12] repack: mark more strings for translation

2018-10-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/repack.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c index c6a7943d5c..0af20fa0fc 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -197,7 +197,7 @@

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-28 Thread Duy Nguyen
On Sun, Oct 28, 2018 at 7:25 AM Torsten Bögershausen wrote: > > On Sat, Oct 27, 2018 at 10:48:23AM +0200, Nguyễn Thái Ngọc Duy wrote: > > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > > can but only in three patterns: > > > > - '**/' matches zero or more leading

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-28 Thread Torsten Bögershausen
On Sat, Oct 27, 2018 at 10:48:23AM +0200, Nguyễn Thái Ngọc Duy wrote: > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > can but only in three patterns: > > - '**/' matches zero or more leading directories > - '/**/' matches zero or more directories in between > - '/**'