Re: [RFC/PATCH] pathspec: allow escaped query values

2016-06-01 Thread Junio C Hamano
Ramsay Jones writes: > Not having given this much thought at all, but the question which comes > to mind is: can you use some other separator for the -s rather than > a comma? That way you don't need to quote them in the part of the > -spec. > > (I dunno, maybe use ; or : instead?) There are tw

Re: git gc and worktrees

2016-06-01 Thread Michael Haggerty
On 06/01/2016 09:39 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> I argue that the fundamental concept in terms of the implementation >> should be the individual physical reference stores, and these should be >> compounded together to form the logical reference collections and the >>

Re: [RFC/PATCH] pathspec: allow escaped query values

2016-06-01 Thread Stefan Beller
On Wed, Jun 1, 2016 at 5:33 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> This change allows escaping characters by a backslash, such that the query >> >> git ls-files :(attr:whitespace=indent\,trail\,space) >> >> will match all path that have the value "indent,trail,space" for the >

Re: [RFC/PATCH] pathspec: allow escaped query values

2016-06-01 Thread Stefan Beller
On Wed, Jun 1, 2016 at 5:38 PM, Ramsay Jones wrote: > > > On 02/06/16 00:52, Stefan Beller wrote: >> In our own .gitattributes file we have attributes such as: >> >> *.[ch] whitespace=indent,trail,space >> >> When querying for attributes we want to be able to ask for the exact >> value, i.e. >

Re: Segfault in the attr stack

2016-06-01 Thread Duy Nguyen
On Thu, Jun 2, 2016 at 8:02 AM, Duy Nguyen wrote: > On Thu, Jun 2, 2016 at 5:17 AM, Junio C Hamano wrote: >> Gaah, of course. >> >> This is coming from the cache preload codepath, where multiple threads >> try to run ce_path_match(). >> It used to be OK because pathspec magic never looked at attr

Re: Segfault in the attr stack

2016-06-01 Thread Duy Nguyen
On Thu, Jun 2, 2016 at 5:17 AM, Junio C Hamano wrote: > Gaah, of course. > > This is coming from the cache preload codepath, where multiple threads > try to run ce_path_match(). > It used to be OK because pathspec magic never looked at attributes, > but now it does, and attribute system is not thr

Re: [RFC/PATCH] pathspec: allow escaped query values

2016-06-01 Thread Ramsay Jones
On 02/06/16 00:52, Stefan Beller wrote: > In our own .gitattributes file we have attributes such as: > > *.[ch] whitespace=indent,trail,space > > When querying for attributes we want to be able to ask for the exact > value, i.e. > > git ls-files :(attr:whitespace=indent,trail,space) >

Re: [RFC/PATCH] pathspec: allow escaped query values

2016-06-01 Thread Junio C Hamano
Stefan Beller writes: > This change allows escaping characters by a backslash, such that the query > > git ls-files :(attr:whitespace=indent\,trail\,space) > > will match all path that have the value "indent,trail,space" for the > whitespace attribute. To accomplish this, we need to modify tw

Re: Segfault in the attr stack

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > Junio C Hamano writes: > >> Gaah, of course. >> >> This is coming from the cache preload codepath, where multiple threads >> try to run ce_path_match(). >> It used to be OK because pathspec magic never looked at attributes, >> but now it does, and attribute system is not

Re: [PATCH] Documentation/git-send-email: fix typo in gmail 2FA section

2016-06-01 Thread Junio C Hamano
SZEDER Gábor writes: > Signed-off-by: SZEDER Gábor > --- > > On top of v2.9.0-rc1~10^2 (Documentation: add instructions to help > setup gmail 2FA, 2016-05-27). Thanks. I didn't spot it when I queued it. > Documentation/git-send-email.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-

[RFC/PATCH] pathspec: allow escaped query values

2016-06-01 Thread Stefan Beller
In our own .gitattributes file we have attributes such as: *.[ch] whitespace=indent,trail,space When querying for attributes we want to be able to ask for the exact value, i.e. git ls-files :(attr:whitespace=indent,trail,space) should work, but the commas are used in the attr magic to i

[PATCH] Documentation/git-send-email: fix typo in gmail 2FA section

2016-06-01 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- On top of v2.9.0-rc1~10^2 (Documentation: add instructions to help setup gmail 2FA, 2016-05-27). Documentation/git-send-email.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.t

Re: Segfault in the attr stack

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > Gaah, of course. > > This is coming from the cache preload codepath, where multiple threads > try to run ce_path_match(). > It used to be OK because pathspec magic never looked at attributes, > but now it does, and attribute system is not thread-safe. The symlink check c

Re: Segfault in the attr stack

2016-06-01 Thread Junio C Hamano
Stefan Beller writes: > I propose to not escape commas, but use > white spaces instead, i.e. > > git status ':(attr:whitespace=indent trail space,attr:label=with > more values)' ':attr(attr:foo:bar)' > > would match > * all files that have the whitespace AND the label setting (matching > exac

Re: Segfault in the attr stack

2016-06-01 Thread Stefan Beller
On Wed, Jun 1, 2016 at 3:11 PM, Junio C Hamano wrote: > > By the way, I just noticed that the part of the > ':(attr:)' syntax would need to be rethought. In the > .gitattributes file everybody has, we see these lines: > > *.[ch] whitespace=indent,trail,space > *.sh whitespace=ind

Re: Segfault in the attr stack

2016-06-01 Thread Junio C Hamano
Gaah, of course. This is coming from the cache preload codepath, where multiple threads try to run ce_path_match(). It used to be OK because pathspec magic never looked at attributes, but now it does, and attribute system is not thread-safe. On Wed, Jun 1, 2016 at 3:11 PM, Stefan Beller wrote: >

Re: Segfault in the attr stack

2016-06-01 Thread Stefan Beller
This can be reproduced on sb/pathspec-label in git.git as well. The key difference I notice is `git ls-files` works perfectly (e.g. in the tests) while `git status` fails. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More m

Re: Segfault in the attr stack

2016-06-01 Thread Junio C Hamano
Stefan Beller writes: > In the Gerrit repo I did > $ echo "/plugins/commit-message-length-validator sub-default" >>>.gitattributes > $ git status ":(attr:sub-default)" > Segmentation fault (core dumped) Thanks. I can reproduce this easily with git.git, e.g. $ cat >>.git/info/at

Segfault in the attr stack

2016-06-01 Thread Stefan Beller
(running git-next) In the Gerrit repo I did $ echo "/plugins/commit-message-length-validator sub-default" >>.gitattributes $ git status ":(attr:sub-default)" Segmentation fault (core dumped) Running this multiple times through gdb, this produces different back traces as it seems that thre

Re: [PATCH] submodule operations: tighten pathspec errors

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: >> Ok I'll fix the variable names; I think for consistency with e.g. >> ls-files --error-unmatch >> we would want to be loose by default and strict on that option. > > I do not think the "typo-prevention" safety measure should suddenly > be turned into opt-in; I'd suggest "

Re: [PATCH] submodule operations: tighten pathspec errors

2016-06-01 Thread Junio C Hamano
Stefan Beller writes: > On Thu, May 26, 2016 at 1:00 PM, Junio C Hamano wrote: > >>> @@ -36,10 +37,9 @@ static int module_list_compute(int argc, const char >>> **argv, >>> >>> for (i = 0; i < active_nr; i++) { >>> const struct cache_entry *ce = active_cache[i]; >>> - >>> -

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 01:56:08PM -0700, Junio C Hamano wrote: > So here is the final version with a log message. > > -- >8 -- > Subject: [PATCH] t5500 & t7403: lose bash-ism "local" > [...] Looks good. Thanks. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body

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

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 03:42:18AM -0400, Jeff King wrote: > I have no idea if those ideas would work. But I wouldn't want to start > looking into either of them without some idea of how much time we're > actually spending on strbuf mallocs (or how much time we would spend if > strbufs were used i

Re: [PATCH] submodule operations: tighten pathspec errors

2016-06-01 Thread Stefan Beller
On Thu, May 26, 2016 at 1:00 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> It's a first initial version with no tests (and probably conflicting with >> some topics in flight), but I was curious how involved this issue actually >> is, >> so I took a stab at implementing it. > > I take it

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Stefan Beller
On Wed, Jun 1, 2016 at 1:48 PM, Junio C Hamano wrote: > John Keeping writes: > >> Absolutely, my original point should have been prefixed with: I wonder >> if the reason we haven't had any problems reported is because ... >> >> And we've got lucky because the clobbering of global variables happen

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Eric Sunshine
On Wed, Jun 1, 2016 at 4:56 PM, Junio C Hamano wrote: > Subject: [PATCH] t5500 & t7403: lose bash-ism "local" > > In t5500::check_prot_host_port_path(), diagport is not a variable > used elsewhere and the function is not recursively called so this > can simply lose the "local", which may not be su

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > John Keeping writes: > >> Absolutely, my original point should have been prefixed with: I wonder >> if the reason we haven't had any problems reported is because ... >> >> And we've got lucky because the clobbering of global variables happens >> not to matter in these pa

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
John Keeping writes: > Absolutely, my original point should have been prefixed with: I wonder > if the reason we haven't had any problems reported is because ... > > And we've got lucky because the clobbering of global variables happens > not to matter in these particular cases. Ah, I did misund

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 09:28:53PM +0100, John Keeping wrote: > > So either way, I do not think "local variable names" that breaks > > &&-chain can be justified. Either the variable must be localized > > for the script to work correctly, in which case we want local with > > &&-chaining, or it doe

Re: [PATCH v3 13/39] i18n: git-sh-setup.sh: mark strings for translation

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > That is correct, but doesn't that hint that the current users of > git-sh-i18n no longer have to (and they probably do not want to) > dot-source it, as they are already dot-sourcing git-sh-setup? > > Otherwise they will waste cycles reading the same thing twice > (assumin

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread John Keeping
On Wed, Jun 01, 2016 at 12:45:11PM -0700, Junio C Hamano wrote: > John Keeping writes: > > > On Wed, Jun 01, 2016 at 03:07:59PM -0400, Jeff King wrote: > >> On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > >> > >> > > > reset_submodule_urls () { > >> > > > -local root > >> >

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

2016-06-01 Thread David Turner
On Wed, 2016-06-01 at 16:09 -0400, Jeff King wrote: > On Wed, Jun 01, 2016 at 03:50:29PM -0400, David Turner wrote: > > > On Wed, 2016-06-01 at 03:42 -0400, Jeff King wrote: > > > 2. Do caching tricks for strbufs used in tight loops. For > > > example, > > > have strbuf_release() throw its

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

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 03:50:29PM -0400, David Turner wrote: > On Wed, 2016-06-01 at 03:42 -0400, Jeff King wrote: > > 2. Do caching tricks for strbufs used in tight loops. For example, > > have strbuf_release() throw its buffer into a last-used cache, > > and > > let the next strbuf_

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

2016-06-01 Thread David Turner
On Wed, 2016-06-01 at 03:42 -0400, Jeff King wrote: > 2. Do caching tricks for strbufs used in tight loops. For example, > have strbuf_release() throw its buffer into a last-used cache, > and > let the next strbuf_grow() use that cache entry. This cuts > malloc() > out of the loop.

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
John Keeping writes: > On Wed, Jun 01, 2016 at 03:07:59PM -0400, Jeff King wrote: >> On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: >> >> > > > reset_submodule_urls () { >> > > > - local root >> > > > - root=$(pwd) && >> > > >( >> > > > + root=$(pwd

Re: git gc and worktrees

2016-06-01 Thread Junio C Hamano
Michael Haggerty writes: > I argue that the fundamental concept in terms of the implementation > should be the individual physical reference stores, and these should be > compounded together to form the logical reference collections and the > sets of reachability roots that are interesting at the

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread John Keeping
On Wed, Jun 01, 2016 at 03:07:59PM -0400, Jeff King wrote: > On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > > > > > reset_submodule_urls () { > > > > - local root > > > > - root=$(pwd) && > > > > ( > > > > + root=$(pwd) && > > > >

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > > > reset_submodule_urls () { > > > - local root > > > - root=$(pwd) && > > > ( > > > + root=$(pwd) && > > > cd super-clone/submodule && > > > git config remote.origin.url "$root/submodule" > > > ) &&

Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-01 Thread David Turner
On Wed, 2016-06-01 at 17:45 +0700, Nguyễn Thái Ngọc Duy wrote: > Current mark_reachable_objects() only marks objects from index from > _current_ worktree as reachable instead of all worktrees. Because > this > function is used for pruning, there is a chance that objects > referenced > by other work

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

2016-06-01 Thread Junio C Hamano
Duy Nguyen writes: >> That is, wouldn't you rather see "worktree lock to/foo" work when >> 'foo' is ambiguous but 'to/foo' is not? > > I don't know. I suppose if people have to make `basename $path` the > same because of some weird build settings, e.g. abc/git and def/git, > then this basename se

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread John Keeping
On Wed, Jun 01, 2016 at 12:37:47PM -0400, Jeff King wrote: > On Wed, Jun 01, 2016 at 09:19:06AM -0700, Junio C Hamano wrote: > > diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh > > index 79bc135..5503ec0 100755 > > --- a/t/t7403-submodule-sync.sh > > +++ b/t/t7403-submodule-sync.

Re: [PATCH v3 13/39] i18n: git-sh-setup.sh: mark strings for translation

2016-06-01 Thread Junio C Hamano
Vasco Almeida writes: > Positional arguments, such as $0, $1, etc, need to be stored on shell > variables for use in translatable strings, according to gettext manual > [1]. > > Add git-sh-setup.sh to LOCALIZED_SH variable in Makefile to enable > extraction of string marked for translation by xge

[PATCH v3 38/39] i18n: unmark die messages for translation

2016-06-01 Thread Vasco Almeida
These messages are relevant for the programmer only, not for the end user. Thus, they can be unmarked for translation, saving translator some work. Signed-off-by: Vasco Almeida --- git-bisect.sh | 2 +- wt-status.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/git-b

[PATCH v3 35/39] i18n: init-db: join message pieces

2016-06-01 Thread Vasco Almeida
Join message displayed during repository initialization in one entire sentence. That would improve translations since it's easier translate an entire sentence than translating each piece. Signed-off-by: Vasco Almeida --- builtin/init-db.c | 17 ++--- 1 file changed, 10 insertions(+),

[PATCH v3 37/39] i18n: submodule: escape shell variables inside eval_gettext

2016-06-01 Thread Vasco Almeida
According to the gettext manual [1], references to shell variables inside eval_gettext call must be escaped so that eval_gettext receives the translatable string before the variable values are substituted into it. [1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.ht

Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-01 Thread Eric Sunshine
On Wed, Jun 1, 2016 at 6:45 AM, Nguyễn Thái Ngọc Duy wrote: > Current mark_reachable_objects() only marks objects from index from > _current_ worktree as reachable instead of all worktrees. Because this > function is used for pruning, there is a chance that objects referenced > by other worktrees

[PATCH v3 34/39] i18n: remote: allow translations to reorder message

2016-06-01 Thread Vasco Almeida
Before this patch, translations couldn't place the branch name where it was better fit in the message "and with remote ". Allow translations that, instead of forcing the branch name to display right of the message. Signed-off-by: Vasco Almeida --- builtin/remote.c | 7 +++ 1 file changed, 3

[PATCH v3 39/39] i18n: branch: mark comment when editing branch description for translation

2016-06-01 Thread Vasco Almeida
When one issues git branch --edit-description branch_name, a edit with that message commented out is opened. Mark that message for translation in to order to be localized. Signed-off-by: Vasco Almeida --- builtin/branch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/

[PATCH v3 36/39] i18n: submodule: join strings marked for translation

2016-06-01 Thread Vasco Almeida
Join strings marked for translation since that would facilitate and improve translations result. Signed-off-by: Vasco Almeida --- git-submodule.sh | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 5a4dec0..91fca56 10

Re: [PATCH v3 28/39] i18n: config: unfold error messages marked for translation

2016-06-01 Thread Junio C Hamano
Vasco Almeida writes: > Introduced in 473166b ("config: add 'origin_type' to config_source > struct", 2016-02-19), Git can inform the user about the origin of a > config error, but the implementation does not allow translators to > translate the keywords 'file', 'blob, 'standard input', and > 'su

Re: [PATCH v3 24/39] i18n: bisect: enable l10n of bisect terms in messages

2016-06-01 Thread Junio C Hamano
Vasco Almeida writes: > +enum term { BAD, GOOD, OLD, NEW }; > +static const char *term_names[] = { > +/* TRANSLATORS: in bisect.c source code file, the following terms are > + used to describe a "bad commit", "good commit", "new revision", etc. > + Please, if you can, check the source when yo

Re: [PATCH v3 48/49] builtin/apply: move 'lock_file' global into 'struct apply_state'

2016-06-01 Thread Junio C Hamano
Christian Couder writes: > We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c > keeps a linked list of all created lock_file structures. So let's make the > 'lock_file' variable a pointer to a 'struct lock_file' Good. > As the same instance of this struct can be reused, l

Re: [PATCH] t4014: shell portability fix

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 09:57:06AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Maybe: > > > > We sometimes get around this by using env, like: > > > > test_must_fail env FOO=BAR some-program > > > > But that works for test_must_fail because it further runs its > > ar

Re: [PATCH] t4014: shell portability fix

2016-06-01 Thread Junio C Hamano
Jeff King writes: > Maybe: > > We sometimes get around this by using env, like: > > test_must_fail env FOO=BAR some-program > > But that works for test_must_fail because it further runs its > arguments via the shell, so we can stick the "env" on the right-hand > side of the

[PATCH v3 26/39] i18n: notes: mark strings for translation

2016-06-01 Thread Vasco Almeida
Mark strings of messages for the user as translatable. Update tests t3310-notes-merge-manual-resolve.sh and t3320-notes-merge-worktrees.sh to reflect new translatable messages. Tests that grep for .git/NOTES_MERGE_WORKTREE reflect the translatable string "Automatic notes merge failed. Fix conflic

[PATCH v3 22/39] t5523: use test_i18ngrep for negation

2016-06-01 Thread Vasco Almeida
Replace the first form with the second one: ! grep expected actual test_i18ngrep ! expected actual The latter syntax is supported by test_i18ngrep defined in t/test-lib.sh. Although the test already passes whether GETTEXT_POSION is enabled, use the i18n grep variant for the sake

[PATCH v3 00/39] i18n and test updates

2016-06-01 Thread Vasco Almeida
Marks several messages for translation and updates tests to pass under GETTEXT_POISON. Some tests were updated to fit previous i18n marks, others were updated to fit marks made by these patches. Patches that only touch test file refer to marks done in commits previous to these ones. This re-roll f

[PATCH v3 29/39] i18n: merge: mark messages for translation

2016-06-01 Thread Vasco Almeida
Mark messages shown to the user for translation. Signed-off-by: Vasco Almeida --- builtin/merge.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c index b555a1b..961def5 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1014,7

[PATCH v3 11/39] i18n: bisect: simplify error message for i18n

2016-06-01 Thread Vasco Almeida
The message was not being extracted by xgettext, although it was marked for translation, seemingly because it contained a command substitution. Moreover, eval_gettext should be used instead of gettext for strings with substitution. See step 4. of section 15.5.2.1 Preparing Shell Scripts for Intern

[PATCH v3 02/39] i18n: advice: mark string about detached head for translation

2016-06-01 Thread Vasco Almeida
Mark string with advice seen by the user when in detached head. Update test t7201-co.sh to pass under GETTEXT_POISON build. Pretend success if the number of lines of "git checkout renamer^" output is not greater than 1 and test are running under GETTEXT_POISON. Signed-off-by: Vasco Almeida ---

[PATCH v3 30/39] i18n: merge: change command option help to lowercase

2016-06-01 Thread Vasco Almeida
Change command option description to lowercase, matching pull counterpart option. Translators would have to translate such message only once. Signed-off-by: Vasco Almeida --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c ind

[PATCH v3 09/39] i18n: rebase: fix marked string to use eval_gettext variant

2016-06-01 Thread Vasco Almeida
The string message marked for translation should use eval_gettext variant instead of the gettext one, since we want to dollar-substitute $head_name in the result. Signed-off-by: Vasco Almeida --- git-rebase.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-rebase.sh b/gi

[PATCH v3 27/39] i18n: notes: mark options for translation

2016-06-01 Thread Vasco Almeida
Mark options description of git prune for translation. Signed-off-by: Vasco Almeida --- builtin/notes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index d11e6eb..0572051 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -934,8 +9

[PATCH v3 21/39] t4153: fix negated test_i18ngrep call

2016-06-01 Thread Vasco Almeida
The function test_i18ngrep fakes success when run under GETTEXT_POISON. Hence, running in the following manner will always fail under gettext poison: ! test_i18ngrep expected actual Use correct syntax: test_i18ngrep ! expected actual For other instance of this issue see 41ca19b ("tests:

[PATCH v3 03/39] i18n: advice: internationalize message for conflicts

2016-06-01 Thread Vasco Almeida
Mark message for translation telling the user she has conflicts to resolve. Expose each particular use case, in order to enable translating entire sentences which would facilitate translating into other languages. Change "Pull" to lowercase to match other instances. Update test t5520-pull.sh, that

[PATCH v3 23/39] i18n: bisect: mark strings for translation

2016-06-01 Thread Vasco Almeida
In the last message, involving Q_(), try to mark the message in such way that is suited for RTL (Right to Left) languages. Update test t6030-bisect-porcelain.sh to reflect the changes. Signed-off-by: Vasco Almeida --- bisect.c| 56 +---

[PATCH v3 31/39] i18n: sequencer: add period to error message

2016-06-01 Thread Vasco Almeida
Add a period to error message so it matches others instances in sequencer.c. Now translator would have to translate such message only once. Signed-off-by: Vasco Almeida --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 57b3671..e9

[PATCH v3 10/39] i18n: rebase: mark placeholder for translation

2016-06-01 Thread Vasco Almeida
Mark placeholder "" in git-rebase.sh for translation. The string containing the named placeholder is passed to shell function error_on_missing_default_upstream in git-parse-remote.sh which uses it to display a command hint for the user. Signed-off-by: Vasco Almeida --- git-rebase.sh | 2 +- 1 fi

[PATCH v3 07/39] i18n: merge-octopus: mark messages for translation

2016-06-01 Thread Vasco Almeida
Mark messages in git-merge-octopus.sh for translation. Signed-off-by: Vasco Almeida --- git-merge-octopus.sh | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/git-merge-octopus.sh b/git-merge-octopus.sh index dc2fd1b..89e967a 100755 --- a/git-merge-octopus.s

[PATCH v3 01/39] i18n: builtin/remote.c: fix mark for translation

2016-06-01 Thread Vasco Almeida
The second string inside _() was not being extracted for translation by xgettext, meaning that, although the string was passed to gettext, there was no translation available. Mark each individual string instead of marking the result of ternary if. Signed-off-by: Vasco Almeida --- builtin/remote

[PATCH v3 08/39] merge-octupus: use die shell function from git-sh-setup.sh

2016-06-01 Thread Vasco Almeida
Source git-sh-setup in order to use die shell function from git-sh-setup.sh library instead of using the one defined in git-merge-octopus.sh. Remove the former die function. Signed-off-by: Vasco Almeida --- git-merge-octopus.sh | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --g

[PATCH v3 28/39] i18n: config: unfold error messages marked for translation

2016-06-01 Thread Vasco Almeida
Introduced in 473166b ("config: add 'origin_type' to config_source struct", 2016-02-19), Git can inform the user about the origin of a config error, but the implementation does not allow translators to translate the keywords 'file', 'blob, 'standard input', and 'submodule-blob'. Moreover, for the s

[PATCH v3 25/39] i18n: transport-helper.c: change N_() call to _()

2016-06-01 Thread Vasco Almeida
The N_() no-op call currently marks the string to be extracted by xgettext but doesn't trigger the retrieval of the translation at run time, whereas _() does both. Meaning that, in spite of having translations available, they were never retrieved to make use of them. Signed-off-by: Vasco Almeida

[PATCH v3 04/39] i18n: transport: mark strings for translation

2016-06-01 Thread Vasco Almeida
Mark one printf string and one error string for translation. Signed-off-by: Vasco Almeida --- transport.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/transport.c b/transport.c index 095e61f..59b911e 100644 --- a/transport.c +++ b/transport.c @@ -59,

[PATCH v3 32/39] i18n: standardise messages

2016-06-01 Thread Vasco Almeida
Standardise messages in order to save translators some work. Nuances fixed in this commit: "failed to read %s" "read of %s failed" "detach the HEAD at named commit" "detach HEAD at named commit" "removing '%s' failed" "failed to remove '%s'" "index file corrupt" "corrupt index file" "failed to

[PATCH v3 19/39] tests: unpack-trees: update to use test_i18n* functions

2016-06-01 Thread Vasco Almeida
Use functions test_i18ncmp and test_i18ngrep to successfully pass tests running under GETTEXT_POISON. The output strings compared to in these test were marked for translation in ed47fdf ("i18n: unpack-trees: mark strings for translation", 2016-04-09) and later improved in 2e3926b ("i18n: unpack-tr

[PATCH v3 16/39] i18n: rebase-interactive: mark comments of squash for translation

2016-06-01 Thread Vasco Almeida
Mark comment messages of squash/fixup file ($squash_msg) for translation. Helper functions this_nth_commit_message and skip_nth_commit_message replace the previous method of making the comment messages (such as "This is the 2nd commit message:") aided by nth_string helper function. This step was t

[PATCH v3 17/39] i18n: setup: mark strings for translation

2016-06-01 Thread Vasco Almeida
Update tests that compare the strings newly marked for translation to succeed when running under GETTEXT_POISON. Signed-off-by: Vasco Almeida --- setup.c| 16 t/t1506-rev-parse-diagnosis.sh | 2 +- t/t4208-log-magic-pathspec.sh | 4 ++-- 3 files change

[PATCH v3 24/39] i18n: bisect: enable l10n of bisect terms in messages

2016-06-01 Thread Vasco Almeida
Enable localization (l10n) of bisect terms in messages for the user. Use an array to explicitly list and mark bisect terms for translation using the no-op N_(). Additionally, this catches at compile time errors such as wrongly writing the bisect terms, e.g., writing "god" instead of "good", since

[PATCH v3 18/39] tests: use test_i18n* functions to suppress false positives

2016-06-01 Thread Vasco Almeida
The test functions test_i18ncmp and test_i18ngrep pretend success if run under GETTEXT_POISON. By using those functions to test output which is correctly marked as translatable, enables one to detect if the strings newly marked for translation are from plumbing output. If they are indeed from plumb

[PATCH v3 33/39] i18n: remote: mark URL fallback text for translation

2016-06-01 Thread Vasco Almeida
Marks fallback text for translation that may be displayed in git remote show output. Signed-off-by: Vasco Almeida --- builtin/remote.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index ae74da6..9f934cb 100644 --- a/builtin/remote.

[PATCH v3 05/39] i18n: sequencer: mark entire sentences for translation

2016-06-01 Thread Vasco Almeida
Mark entire sentences of error message rather than assembling one using placeholders (e.g. "Cannot %s during a %s"). That would facilitate translation work because it is easier to translate a entire sentence than translating pieces. We would have better translations at the expense of source code v

[PATCH v3 13/39] i18n: git-sh-setup.sh: mark strings for translation

2016-06-01 Thread Vasco Almeida
Positional arguments, such as $0, $1, etc, need to be stored on shell variables for use in translatable strings, according to gettext manual [1]. Add git-sh-setup.sh to LOCALIZED_SH variable in Makefile to enable extraction of string marked for translation by xgettext. Although git-sh-setup.sh is

[PATCH v3 20/39] t9003: become resilient to GETTEXT_POISON

2016-06-01 Thread Vasco Almeida
The test t9003-help-autocorrect.sh fails when run under GETTEXT_POISON, because it's expecting to filter out the original output. Accommodate gettext poison case by also filtering out the default simulated output. Signed-off-by: Vasco Almeida --- t/t9003-help-autocorrect.sh | 4 ++-- 1 file chan

[PATCH v3 15/39] i18n: rebase-interactive: mark here-doc strings for translation

2016-06-01 Thread Vasco Almeida
Use pipe to send gettext output to git stripspace instead of the original method of using shell here-document, because command substitution '$(...)' would not take place inside the here-documents. The exception is the case of the last here-document redirecting to cat, in which commands substitution

[PATCH v3 14/39] i18n: rebase-interactive: mark strings for translation

2016-06-01 Thread Vasco Almeida
Mark strings in git-rebase--interactive.sh for translation. There is no need to source git-sh-i18n since git-rebase.sh already does so. Add git-rebase--interactive.sh to LOCALIZED_SH in Makefile in order to enable extracting strings marked for translation by xgettext. Signed-off-by: Vasco Almeida

[PATCH v3 06/39] i18n: sequencer: mark string for translation

2016-06-01 Thread Vasco Almeida
Mark informative string ": fast-forward" for translation. Signed-off-by: Vasco Almeida --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 88a7c78..57b3671 100644 --- a/sequencer.c +++ b/sequencer.c @@ -225,7 +225,7 @@ static int fa

[PATCH v3 12/39] t6030: update to use test_i18ncmp

2016-06-01 Thread Vasco Almeida
Since the git bisect output tested here is subject to translation, the helper function test_i18ncmp should be used over test_cmp. Signed-off-by: Vasco Almeida --- t/t6030-bisect-porcelain.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t6030-bisect-porcelain.sh b/t/t

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 09:19:06AM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > These are two other offenders. > > > > $ git grep '^[ ]local[]' \*.sh > > t/t5500-fetch-pack.sh: local diagport > > t/t7403-submodule-sync.sh: local root > > > > The grep gives many

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > These are two other offenders. > > $ git grep '^[ ]local[]' \*.sh > t/t5500-fetch-pack.sh:local diagport > t/t7403-submodule-sync.sh:local root > > The grep gives many other hits, but those in completion are OK; it > is designed to be specific

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > relative_path () > { > local target curdir result > target=$1 > curdir=${2-$wt_prefix} > > I am hoping that Stefan's "gradually rewrite things in C" will make > it unnecessary to worry about this one. "git submodule" would not > work correctly on posixl

Re: git gc and worktrees

2016-06-01 Thread Michael Haggerty
On 06/01/2016 05:15 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> I think reference stores are going to need two distinct types of >> reference iteration: one to iterate over the *logical* reference space >> of a single repo or worktree, and one to find all *local* references >> and/o

Re: [PATCH] t4014: shell portability fix

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 08:07:16AM -0700, Junio C Hamano wrote: > > Here's the patch I wrote up earlier (but was too timid to send out after > > my barrage of emails :) ). > > Looks very sensible. I'll drop all these "Attempt to test with > ksh93 found these breakages" patches and queue this one

Re: [PATCH 0/4] Fix prune/gc problem with multiple worktrees

2016-06-01 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > This series makes sure that objects referenced by all worktrees are > marked reachable so that we don't accidentally delete objects that are > being used. Previously per-worktree references in index, detached HEAD > or per-worktree reflogs come from current worktre

Re: [PATCH 0/4] Fix prune/gc problem with multiple worktrees

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 05:45:15PM +0700, Nguyễn Thái Ngọc Duy wrote: > This series makes sure that objects referenced by all worktrees are > marked reachable so that we don't accidentally delete objects that are > being used. Previously per-worktree references in index, detached HEAD > or per-wor

Re: [PATCH] add: add --chmod=+x / --chmod=-x options

2016-06-01 Thread Junio C Hamano
Johannes Schindelin writes: > Hi Junio & Ed, > > On Tue, 31 May 2016, Junio C Hamano wrote: > >> Edward Thomson writes: >> >> > +static char *chmod_arg = NULL; >> > + >> >> I'll drop " = NULL", as it is our convention to let BSS take care of >> the zero initialization for global variables as m

Re: [PATCH 4/4] reachable.c: make reachable reflogs for all per-worktree reflogs

2016-06-01 Thread Michael Haggerty
On 06/01/2016 12:45 PM, Nguyễn Thái Ngọc Duy wrote: > [...] > +void add_worktree_reflogs_to_pending(struct rev_info *revs, unsigned flags, > + struct worktree *wt) > +{ > + struct all_refs_cb cb; > + char *path; > + > + cb.all_revs = revs; > + cb.all

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

2016-06-01 Thread Antoine Queru
> Matthieu Moy writes: > > > Actually, that's even: don't you want to use a valid email address in > > your Signed-off-by: ? ;-) > > > > @ensimag.grenoble-inp.fr => student's current adress > > @grenoble-inp.org => students lifelong address. If not already done, > > students

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

2016-06-01 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Jun 1, 2016 at 12:55 AM, Junio C Hamano wrote: >> Nguyễn Thái Ngọc Duy writes: >> >>> We need this later to avoid double locking a worktree, or unlocking one >>> when it's not even locked. >> >> Shouldn't this be done lazily? >> >> If a user is working in worktree

Re: git gc and worktrees

2016-06-01 Thread Junio C Hamano
Michael Haggerty writes: > I think reference stores are going to need two distinct types of > reference iteration: one to iterate over the *logical* reference space > of a single repo or worktree, and one to find all *local* references > and/or reachability roots (e.g., when run within a linked r

  1   2   >