Re: [PATCH 2/2] bisect--helper: `bisect_voc` shell function in C

2016-05-15 Thread Johannes Schindelin
Hi Pranit, On Sat, 14 May 2016, Pranit Bauva wrote: > Reimplement the `bisect_voc` shell function in C. This is a too small > function to be called as a subcommand though the working of this > function has been tested by calling it as a subcommand. This leaves me puzzled as to what this patch is

Re: [PATCH] Ignore dirty submodule states during stash

2016-05-15 Thread Stefan Beller
On Sun, May 15, 2016 at 7:07 PM, Vasily Titskiy wrote: > Do not save states of submodules as stash should ignore it. Can you explain why this is a good idea? (It is not obvious to me either way.) Do we need a test/documentation updates for this? > > Signed-off-by: Vasily Titskiy > --- > git-s

Re: [PATCH v2 0/2] Work on t3404 in preparation for rebase--helper

2016-05-15 Thread Johannes Schindelin
Hi Junio, On Fri, 13 May 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > On Thu, 12 May 2016, Junio C Hamano wrote: > > > >> I took these separately already, and plan to fast-track them as they > >> are both "trivially correct"; I double checked that what I have match > >> these

Re: [PATCH] commit.c: use strchrnul() to scan for one line

2016-05-15 Thread Johannes Schindelin
Hi Junio, On Sun, 15 May 2016, Junio C Hamano wrote: > diff --git a/commit.c b/commit.c > index 3f4f371..1f9ee8a 100644 > --- a/commit.c > +++ b/commit.c > @@ -415,8 +415,7 @@ int find_commit_subject(const char *commit_buffer, const > char **subject) > p++; > if (*p) { >

Re: [PATCH] attr.c: simplify macroexpand_one()

2016-05-15 Thread Junio C Hamano
On Sun, May 15, 2016 at 8:31 PM, Eric Sunshine wrote: > On Sun, May 15, 2016 at 6:57 PM, Junio C Hamano wrote: >> The double-loop wants to do an early return immediately when one >> matching macro is found. Eliminate the extra variable 'a' used for >> that purpose and rewrite the "assign found i

Re: [PATCH v2 63/94] builtin/apply: make apply_all_patches() return -1 on error

2016-05-15 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:17 AM, Christian Couder wrote: > To finish libifying the apply functionality, apply_all_patches() should not > die() or exit() in case of error, but return -1. > > While doing that we must take care that file descriptors are properly closed > and, if needed, reset a sensi

Re: [PATCH v2 60/94] apply: make init_apply_state() return -1 instead of exit()ing

2016-05-15 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:17 AM, Christian Couder wrote: > To libify `git apply` functionality we have to signal errors to the > caller instead of exit()ing. > > To do that in a compatible manner with the rest of the error handling > in "builtin/apply.c", init_apply_state() should return -1 using

Re: [PATCH] attr.c: simplify macroexpand_one()

2016-05-15 Thread Eric Sunshine
On Sun, May 15, 2016 at 6:57 PM, Junio C Hamano wrote: > The double-loop wants to do an early return immediately when one > matching macro is found. Eliminate the extra variable 'a' used for > that purpose and rewrite the "assign found itme to 'a' to make it What's "itme"? > non-NULL and force

Re: [PATCH v2 59/94] builtin/apply: move init_apply_state() to apply.c

2016-05-15 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:17 AM, Christian Couder wrote: > To libify `git apply` functionality we must make init_apply_state() > usable outside "builtin/apply.c". > > Let's do that by moving it into a new "apply.c". Similar to my comment about apply.h and 'struct apply_state', I can easily see ap

Re: [PATCH v2 56/94] apply: move 'struct apply_state' to apply.h

2016-05-15 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:17 AM, Christian Couder wrote: > To libify `git apply` functionality we must make 'struct apply_state' > usable outside "builtin/apply.c". Why is this patch plopped right in the middle of a bunch of other patches which are making functions return -1 rather than die()ing?

Re: [PATCH v2 54/94] builtin/apply: make parse_chunk() return a negative integer on error

2016-05-15 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:17 AM, Christian Couder wrote: > To libify `git apply` functionality we have to signal errors to the > caller instead of die()ing or exit()ing. > > To do that in a compatible manner with the rest of the error handling > in builtin/apply.c, find_header() should return -1 i

[PATCH] Ignore dirty submodule states during stash

2016-05-15 Thread Vasily Titskiy
Do not save states of submodules as stash should ignore it. Signed-off-by: Vasily Titskiy --- git-stash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-stash.sh b/git-stash.sh index c7c65e2..b500c44 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -116,7 +116,7 @@ creat

Re: [PATCH v2 52/94] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-05-15 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:17 AM, Christian Couder wrote: > To libify `git apply` functionality we have to signal errors to the > caller instead of die()ing. Let's do that by using error() instead > of die()ing in read_patch_file(). > > Signed-off-by: Christian Couder > --- > diff --git a/builtin/

Re: git push --quiet option does not seem to work

2016-05-15 Thread Jeff King
On Sun, May 15, 2016 at 08:51:53PM -0400, Chris B wrote: > I did not see in your example any commit. But if you say so. I didn't show the commit step. But you can see that I made two identical pushes, one quiet and one not, and the non-quiet one actually pushed commits and showed the progress met

Re: git push --quiet option does not seem to work

2016-05-15 Thread Chris B
I did not see in your example any commit. But if you say so. I saw git init which would be a new repo.. don't know if it makes a difference. It's pushing to HTTPS. I can provide the real example tomorrow. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message t

Re: [PATCH 5/5] worktree: add "unlock" command

2016-05-15 Thread Eric Sunshine
On Tue, May 10, 2016 at 10:17 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/builtin/worktree.c b/builtin/worktree.c > @@ -498,6 +499,34 @@ static int lock_worktree(int ac, const char **av, const > char *prefix) > +static int unlock_worktree(int ac, co

Re: [PATCH 4/5] worktree: add "lock" command

2016-05-15 Thread Eric Sunshine
On Tue, May 10, 2016 at 10:17 AM, Nguyễn Thái Ngọc Duy wrote: > +static int lock_worktree(int ac, const char **av, const char *prefix) > +{ > + const char *reason = "", *old_reason; > + struct option options[] = { > + OPT_STRING(0, "reason", &reason, N_("string"), > +

Re: [PATCH v5 0/2] bisect--helper: rewrite of check-term-format()

2016-05-15 Thread Eric Sunshine
On Sun, May 8, 2016 at 9:34 AM, Pranit Bauva wrote: > On Sun, May 8, 2016 at 11:53 AM, Pranit Bauva wrote: >> On Sun, May 8, 2016 at 7:55 AM, Junio C Hamano wrote: >>> Pranit Bauva writes: I completely missed your point and you want me to go the Eric Sunshine's way? >>> >>> I am neut

Re: [PATCH 4/5] worktree: add "lock" command

2016-05-15 Thread Eric Sunshine
On Tue, May 10, 2016 at 10:17 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > @@ -11,6 +11,7 @@ SYNOPSIS > [verse] > 'git worktree add' [-f] [--detach] [--checkout] [-b ] > [] > 'git

[PATCH v5 1/9] connect: call get_host_and_port() earlier

2016-05-15 Thread Mike Hommey
Currently, get_host_and_port() is called in git_connect() for the ssh protocol, and in git_tcp_connect_sock() for the git protocol. Instead of doing this, just call it from a single place, right after parse_connect_url(), and pass the host and port separately to git_*_connect() functions. We howev

[PATCH v5 8/9] connect: actively reject git:// urls with a user part

2016-05-15 Thread Mike Hommey
Currently, urls of the for git://user@host don't work because user@host is not resolving at the DNS level, but we shouldn't be relying on it being an invalid host name, and actively reject it for containing a username in the first place. Signed-off-by: Mike Hommey --- connect.c | 3 +++ 1 file c

[PATCH v5 0/9] connect: various cleanups

2016-05-15 Thread Mike Hommey
I removed the two controvertial patches, and applied the various suggestions from the last cycle. Mike Hommey (9): connect: call get_host_and_port() earlier connect: only match the host with core.gitProxy connect: fill the host header in the git protocol with the host and port variables

[PATCH v5 3/9] connect: fill the host header in the git protocol with the host and port variables

2016-05-15 Thread Mike Hommey
The last use of the hostandport variable, besides being strdup'ed before being split into host and port, is to fill the host header in the git protocol. Instead of relying on parse_connect_url() to return a host:port string that makes sense there, construct one from the host and port variables. S

[PATCH v5 4/9] connect: make parse_connect_url() return separated host and port

2016-05-15 Thread Mike Hommey
Now that nothing besides CONNECT_DIAG_URL is using hostandport, we can have parse_connect_url() itself do the host and port splitting. This still leaves "user@" part of the host, if there is one, which will be addressed in a subsequent change. This however does add /some/ handling of the "user@" p

[PATCH v5 6/9] connect: make parse_connect_url() return the user part of the url as a separate value

2016-05-15 Thread Mike Hommey
Signed-off-by: Mike Hommey --- connect.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/connect.c b/connect.c index 8813f90..c40ff35 100644 --- a/connect.c +++ b/connect.c @@ -588,11 +588,13 @@ static char *get_port(char *host) * Extract p

[PATCH v5 5/9] connect: group CONNECT_DIAG_URL handling code

2016-05-15 Thread Mike Hommey
Previous changes made both branches handling CONNECT_DIAG_URL identical. We can now remove one of those branches and have CONNECT_DIAG_URL be handled in one place. Signed-off-by: Mike Hommey --- connect.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/connec

[PATCH v5 9/9] connect: move ssh command line preparation to a separate function

2016-05-15 Thread Mike Hommey
Signed-off-by: Mike Hommey --- connect.c | 108 +- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/connect.c b/connect.c index fdd40b0..ae9ef7b 100644 --- a/connect.c +++ b/connect.c @@ -673,6 +673,61 @@ static enum proto

[PATCH v5 7/9] connect: change the --diag-url output to separate user and host

2016-05-15 Thread Mike Hommey
Signed-off-by: Mike Hommey --- connect.c | 6 ++ t/t5500-fetch-pack.sh | 14 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/connect.c b/connect.c index c40ff35..df15ff3 100644 --- a/connect.c +++ b/connect.c @@ -703,10 +703,8 @@ struct child_proces

[PATCH v5 2/9] connect: only match the host with core.gitProxy

2016-05-15 Thread Mike Hommey
Currently, core.gitProxy doesn't actually match purely on domain names as documented: it also matches ports. So a core.gitProxy value like "script for kernel.org" doesn't make the script called for an url like git://kernel.org:port/path, while it is called for git://kernel.org/path. This per-port

Re: [RFC PATCH 0/4] pathspec labels [WAS: submodule groups]

2016-05-15 Thread Duy Nguyen
On Mon, May 16, 2016 at 2:33 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Duy Nguyen writes: >> >>> Instead of putting everything in under the same attribute name >>> "label", make one attribute per label? Would this work? >>> >>> *.[ch] c-group code-group >> >> The attribute subsyste

[PATCH] attr: update a stale comment on "struct match_attr"

2016-05-15 Thread Junio C Hamano
When 82dce998 (attr: more matching optimizations from .gitignore, 2012-10-15) changed a pointer to a string "*pattern" into an embedded "struct pattern" in struct match_attr, it forgot to update the comment that describes the structure. Signed-off-by: Junio C Hamano --- attr.c | 5 ++--- 1 file

[PATCH] attr: explain the lack of attr-name syntax check in parse_attr()

2016-05-15 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c b/attr.c index 94b27f4..aac5c8f 100644 --- a/attr.c +++ b/attr.c @@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int lineno, const char *cp, retu

[PATCH] attr: complete a sentence in a comment

2016-05-15 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index aac5c8f..a19946a 100644 --- a/attr.c +++ b/attr.c @@ -300,7 +300,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src, * directory (ag

[PATCH] attr.c: simplify macroexpand_one()

2016-05-15 Thread Junio C Hamano
The double-loop wants to do an early return immediately when one matching macro is found. Eliminate the extra variable 'a' used for that purpose and rewrite the "assign found itme to 'a' to make it non-NULL and force the loop(s) to terminate" with a direct return from there. Signed-off-by: Junio

[PATCH] attr.c: mark where #if DEBUG ends more clearly

2016-05-15 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index a7f2c3f..95416d3 100644 --- a/attr.c +++ b/attr.c @@ -469,7 +469,7 @@ static void debug_set(const char *what, const char *match, struct git_attr *attr #define debu

[PATCH] attr.c: use strchrnul() to scan for one line

2016-05-15 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index a19946a..a7f2c3f 100644 --- a/attr.c +++ b/attr.c @@ -407,8 +407,8 @@ static struct attr_stack *read_attr_from_index(const char *path, int macro_ok) for

[PATCH] commit.c: use strchrnul() to scan for one line

2016-05-15 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 3f4f371..1f9ee8a 100644 --- a/commit.c +++ b/commit.c @@ -415,8 +415,7 @@ int find_commit_subject(const char *commit_buffer, const char **subject)

Re: [PATCH v1 3/3] convert: ce_compare_data() checks for a sha1 of a path

2016-05-15 Thread Junio C Hamano
tbo...@web.de writes: > -static int has_cr_in_index(const char *path) > +static int has_cr_in_index(const char *path, const unsigned char *sha1) > { > unsigned long sz; > void *data; > int has_cr; > - > - data = read_blob_data_from_cache(path, &sz); > - if (!data) > +

Re: git push --quiet option does not seem to work

2016-05-15 Thread Jeff King
On Sun, May 15, 2016 at 04:29:36PM -0400, Chris B wrote: > Try it by making some changes to files and committing them, and then push. > It works fine for me when there is nothing to actually push, but not > so when there are commits to push. In my example there were commits to push. As you noted

Students contributing to Git

2016-05-15 Thread Erwan Mathoniere
Hello Git community, We're a group of french students from Grenoble INP - Ensimag. As part of an academic project, mentored by Matthieu Moy, we chose to spend the four next weeks contributing to Git. We're now picking ideas in order to help the community the most effective way and we're eager to

Students contributing to Git

2016-05-15 Thread Erwan Mathoniere
Hello Git community, We're a group of french students from Grenoble INP - Ensimag. As part of an academic project, mentored by Matthieu Moy, we chose to spend the four next weeks contributing to Git. We're now picking ideas in order to help the community the most effective way and we're eager to

Re: 'git diff-index' doesn't honor the 'diff.algorithm' variable

2016-05-15 Thread Dmitry Gutov
On 05/15/2016 09:43 PM, Junio C Hamano wrote: I think the paragraph is shared among the "diff" family of commands both plumbing and Porcelain, so I'd say "patches welcome" at this point ;-). I think I've done my part here. It's not like this is a feature request. The script was an illustrati

Re: git push --quiet option does not seem to work

2016-05-15 Thread Chris B
By the way, I also notice by your prompt you seem to be testing this in Linux. I did indicate I'm using the Windows version. That might make a difference. On Sun, May 15, 2016 at 4:29 PM, Chris B wrote: > Try it by making some changes to files and committing them, and then push. > It works fine

Re: git push --quiet option does not seem to work

2016-05-15 Thread Chris B
Try it by making some changes to files and committing them, and then push. It works fine for me when there is nothing to actually push, but not so when there are commits to push. It always outputs the progress to STDERR even when I add --quiet. On Fri, May 13, 2016 at 6:33 PM, Jeff King wrote:

Re: [RFC PATCH 0/4] pathspec labels [WAS: submodule groups]

2016-05-15 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> Instead of putting everything in under the same attribute name >> "label", make one attribute per label? Would this work? >> >> *.[ch] c-group code-group > > The attribute subsystem expects that there will not be unbounded > large number of attrib

Re: [GSOC Update] Week 2

2016-05-15 Thread Pranit Bauva
Hey Junio, On Mon, May 16, 2016 at 12:41 AM, Junio C Hamano wrote: > Pranit Bauva writes: > >>is available for testing on the pu branch. I am encouraging people to >>test it and provide useful comments. > > Do not encourage people to "TEST". In general, do not put too much > weight on t

Re: [GSOC Update] Week 2

2016-05-15 Thread Junio C Hamano
Matthieu Moy writes: > Pranit Bauva writes: > >> = SUMMARY == >> My micro project on adding config variable to git-commit for verbose options >> is going to be merged with the master branch soon and will be available for >> git 2.8.

Re: [GSOC Update] Week 2

2016-05-15 Thread Junio C Hamano
Pranit Bauva writes: >is available for testing on the pu branch. I am encouraging people to >test it and provide useful comments. Do not encourage people to "TEST". In general, do not put too much weight on testing. The result would only measure a small portion of what you wrote in the

Re: [PATCH] crlf: Add test showing double warning on commit

2016-05-15 Thread Junio C Hamano
Torsten Bögershausen writes: > Nja, (Or Nyes in English), the old handling tried to be "nice" to the user: > $ git add text # gave warning > #User forgets, does other things, git reset HEAD > $ git commit # Gave the warning one more time, to remind the user, > # what he did, and

Re: 'git diff-index' doesn't honor the 'diff.algorithm' variable

2016-05-15 Thread Junio C Hamano
Dmitry Gutov writes: > OK, that makes sense. You might want to fix the man page, though, it > says, like the 'git diff' one, "For instance, if you configured > diff.algorithm variable to a non-default value and want to use the > default one, then you have to use --diff-algorithm=default option.".

Re: [PATCH v2 00/94] libify apply and use lib in am

2016-05-15 Thread Junio C Hamano
Christian Couder writes: > On Sat, May 14, 2016 at 8:31 PM, Junio C Hamano wrote: >> >> I however do not see a reason why you need to expose that feature to >> the users of "git apply". So I am not sure if any of us care deeply >> the choice among --silent, --quiet and -q -q. > > About that I w

Re: [RFC PATCH 0/4] pathspec labels [WAS: submodule groups]

2016-05-15 Thread Junio C Hamano
Duy Nguyen writes: > Instead of putting everything in under the same attribute name > "label", make one attribute per label? Would this work? > > *.[ch] c-group code-group The attribute subsystem expects that there will not be unbounded large number of attributes, so this is not a good direction

Re: [GSOC Update] Week 2

2016-05-15 Thread Matthieu Moy
Pranit Bauva writes: > = SUMMARY == > My micro project on adding config variable to git-commit for verbose options > is going to be merged with the master branch soon and will be available for > git 2.8.3 . Nit: being merged to mast

[GSOC Update] Week 2

2016-05-15 Thread Pranit Bauva
= SUMMARY == My micro project on adding config variable to git-commit for verbose options is going to be merged with the master branch soon and will be available for git 2.8.3 . I also rewrote a few shell functions in C. My public git

[BUG] A part of an edge from an octopus merge gets colored, even with --color=never

2016-05-15 Thread Noam Postavsky
With a certain topology involving an octopus merge, git log --graph --oneline --all --color=never produces output which includes some ANSI escape code coloring. Attached is a script to reproduce the problem (creates a git repository in subdir log-format-test), along with sample graph and valgrind o

[PATCH v2 1/3] read-cache: factor out get_sha1_from_index() helper

2016-05-15 Thread tboegi
From: Torsten Bögershausen Factor out the retrieval of the sha1 for a given path in read_blob_data_from_index() into the function get_sha1_from_index(). This will be used in the next commit, when convert.c can do the analyze for "text=auto" without slurping the whole blob into memory at once. A

[PATCH v2 2/3] convert: ce_compare_data() checks for a sha1 of a path

2016-05-15 Thread tboegi
From: Torsten Bögershausen To compare a file in working tree with the index, convert_to_git() is used, the the result is hashed and the hash value compared with ce->sha1. Deep down would_convert_crlf_at_commit() is invoked, to check if CRLF are converted or not: When a CRLF had been in the index

[PATCH v2 3/3] t6038; use crlf on all platforms

2016-05-15 Thread tboegi
From: Torsten Bögershausen t6038 uses different code, dependig if NATIVE_CRLF is set ot not. When the native line endings are LF, merge.renormalize is not tested very well. Change the test to always use CRLF by setting core.eol=crlf. --- t/t6038-merge-text-auto.sh | 37 +++---

[PATCH v2 0/3] CRLF-Handling: bug fix around ce_compare_data()

2016-05-15 Thread tboegi
From: Torsten Bögershausen Changes since v1: - Re-order the patches - t6038; use crlf on all platforms This did actually not break anything (without old 7/10) Adapt the commit message - ce_compare_data(): Simplify the logic around free() in has_cr_in_index(), Thanks Eric Sun

[PATCH v6 17/17] branch: implement '--format' option

2016-05-15 Thread Karthik Nayak
Implement the '--format' option provided by 'ref-filter'. This lets the user list branches as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak -

[PATCH v6 16/17] branch: use ref-filter printing APIs

2016-05-15 Thread Karthik Nayak
Port branch.c to use ref-filter APIs for printing. This clears out most of the code used in branch.c for printing and replaces them with calls made to the ref-filter library. Introduce build_format() which gets the format required for printing of refs. Make amendments to print_ref_list() to reflec

[PATCH v6 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms

2016-05-15 Thread Karthik Nayak
Add the options `:dir` and `:base` to all ref printing ('%(refname)', '%(symref)', '%(push)' and '%(upstream)') atoms. The `:dir` option gives the directory (the part after $GIT_DIR/) of the ref without the refname. The `:base` option gives the base directory of the given ref (i.e. the directory fo

[PATCH v6 10/17] ref-filter: introduce refname_atom_parser_internal()

2016-05-15 Thread Karthik Nayak
Since there are multiple atoms which print refs ('%(refname)', '%(symref)', '%(push)', '%upstream'), it makes sense to have a common ground for parsing them. This would allow us to share implementations of the atom modifiers between these atoms. Introduce refname_atom_parser_internal() to act as a

[PATCH v6 14/17] ref-filter: allow porcelain to translate messages in the output

2016-05-15 Thread Karthik Nayak
Introduce setup_ref_filter_porcelain_msg() so that the messages used in the atom %(upstream:track) can be translated if needed. This is needed as we port branch.c to use ref-filter's printing API's. Written-by: Matthieu Moy Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by:

[PATCH v6 12/17] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()

2016-05-15 Thread Karthik Nayak
Use the recently introduced refname_atom_parser_internal() within remote_ref_atom_parser(), this provides a common base for all the ref printing atoms, allowing %(upstream) and %(push) to also use the ':strip' option. The atoms '%(push)' and '%(upstream)' will retain the ':track' and ':trackshort'

[PATCH v6 09/17] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-05-15 Thread Karthik Nayak
The "%(symref)" atom doesn't work when used with the ':short' modifier because we strictly match only 'symref' for setting the 'need_symref' indicator. Fix this by using comparing with valid_atom rather than used_atom. Add tests for %(symref) and %(symref:short) while we're here. Helped-by: Junio

[PATCH v6 15/17] branch, tag: use porcelain output

2016-05-15 Thread Karthik Nayak
Call ref-filter's setup_ref_filter_porcelain_msg() to enable translated messages for the %(upstream:tack) atom. Although branch.c doesn't currently use ref-filter's printing API's, this will ensure that when it does in the future patches, we do not need to worry about translation. Written-by: Matt

[PATCH v6 11/17] ref-filter: introduce symref_atom_parser() and refname_atom_parser()

2016-05-15 Thread Karthik Nayak
Using refname_atom_parser_internal(), introduce symref_atom_parser() and refname_atom_parser() which will parse the atoms %(symref) and %(refname) respectively. Store the parsed information into the 'used_atom' structure based on the modifiers used along with the atoms. Now the '%(symref)' atom su

[PATCH v6 06/17] ref-filter: introduce format_ref_array_item()

2016-05-15 Thread Karthik Nayak
To allow column display, we will need to first render the output in a string list to allow print_columns() to compute the proper size of each column before starting the actual output. Introduce the function format_ref_array_item() that does the formatting of a ref_array_item to an strbuf. show_ref

[PATCH v6 08/17] ref-filter: add support for %(upstream:track,nobracket)

2016-05-15 Thread Karthik Nayak
Add support for %(upstream:track,nobracket) which will print the tracking information without the brackets (i.e. "ahead N, behind M"). This is needed when we port branch.c to use ref-filter's printing APIs. Add test and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matth

[PATCH v6 02/17] ref-filter: include reference to 'used_atom' within 'atom_value'

2016-05-15 Thread Karthik Nayak
Ensure that each 'atom_value' has a reference to its corresponding 'used_atom'. This let's us use values within 'used_atom' in the 'handler' function. Hence we can get the %(align) atom's parameters directly from the 'used_atom' therefore removing the necessity of passing %(align) atom's parameter

[PATCH v6 01/17] ref-filter: implement %(if), %(then), and %(else) atoms

2016-05-15 Thread Karthik Nayak
Implement %(if), %(then) and %(else) atoms. Used as %(if)...%(then)...%(end) or %(if)...%(then)...%(else)...%(end). If the format string between %(if) and %(then) expands to an empty string, or to only whitespaces, then the whole %(if)...%(end) expands to the string following %(then). Otherwise, it

[PATCH v6 03/17] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-05-15 Thread Karthik Nayak
Implement %(if:equals=) wherein the if condition is only satisfied if the value obtained between the %(if:...) and %(then) atom is the same as the given ''. Similarly, implement (if:notequals=) wherein the if condition is only satisfied if the value obtained between the %(if:...) and %(then) atom

[PATCH v6 05/17] ref-filter: move get_head_description() from branch.c

2016-05-15 Thread Karthik Nayak
Move the implementation of get_head_description() from branch.c to ref-filter. This gives a description of the HEAD ref if called. This is used as the refname for the HEAD ref whenever the FILTER_REFS_DETACHED_HEAD option is used. Make it public because we need it to calculate the length of the HE

[PATCH v6 07/17] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-05-15 Thread Karthik Nayak
Borrowing from branch.c's implementation print "[gone]" whenever an unknown upstream ref is encountered instead of just ignoring it. This makes sure that when branch.c is ported over to using ref-filter APIs for printing, this feature is not lost. Make changes to t/t6300-for-each-ref.sh and Docum

[PATCH v6 04/17] ref-filter: modify "%(objectname:short)" to take length

2016-05-15 Thread Karthik Nayak
Add support for %(objectname:short=) which would print the abbreviated unique objectname of given length. When no length is specified, the length is 'DEFAULT_ABBREV'. The minimum length is 'MINIMUM_ABBREV'. The length may be exceeded to ensure that the provided object name is unique. Add tests and

[PATCH v6 00/17] Port branch.c to use ref-filter's printing options

2016-05-15 Thread Karthik Nayak
This is part of unification of the commands 'git tag -l, git branch -l and git for-each-ref'. This ports over branch.c to use ref-filter's printing options. Initially posted here: $(gmane/279226). It was decided that this series would follow up after refactoring ref-filter parsing mechanism, which

Re: 'git diff-index' doesn't honor the 'diff.algorithm' variable

2016-05-15 Thread Dmitry Gutov
Hi Junio, On 05/14/2016 09:40 PM, Junio C Hamano wrote: The variable belongs to UI config, meant for Porcelain "git diff", together with things like "diff.color", "diff.context", etc. OK, that makes sense. You might want to fix the man page, though, it says, like the 'git diff' one, "For ins

Re: [RFC PATCH 0/4] pathspec labels [WAS: submodule groups]

2016-05-15 Thread Duy Nguyen
On Fri, May 13, 2016 at 7:19 AM, Stefan Beller wrote: > After some fruitful discussion[1] in which Junio suggested trying a very > different route[2] that is more general and not submodule related, I > considered > doing a mock for this. > > This lets you label arbitrary pathspecs, e.g. in git.gi

Re: [PATCH v10 20/20] untracked-cache: config option

2016-05-15 Thread Duy Nguyen
On Fri, May 13, 2016 at 3:20 AM, David Turner wrote: > Add a config option to populate the untracked cache. > > For installations that have centrally-managed configuration, it's > easier to set a config once than to run update-index on every > repository. This sounds like the job for core.untrack