[PATCH v3 7/8] branch.c: use 'ref-filter' APIs

2015-08-21 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' APIs for iterating through refs sorting. This removes most of the code used in 'branch.c' replacing it with calls to the 'ref-filter' library. Make 'branch.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out tags based on the options set. We

[PATCH v3 8/8] branch: add '--points-at' option

2015-08-21 Thread Karthik Nayak
Add the '--points-at' option provided by 'ref-filter'. The option lets the user to list only branches which points at the given object. Add documentation and tests for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-branch.t

[PATCH v3 6/8] branch.c: use 'ref-filter' data structures

2015-08-21 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'branch.c' to use 'ref-filter' APIs. This is a temporary step before porting 'branch.c' to use 'ref-filter' completely. As this is a temporary step, most o

[PATCH v3 3/8] branch: roll show_detached HEAD into regular ref_list

2015-08-21 Thread Karthik Nayak
Remove show_detached() and make detached HEAD to be rolled into regular ref_list by adding REF_DETACHED_HEAD as a kind of branch and supporting the same in append_ref(). This eliminates the need for an extra function and helps in easier porting of branch.c to use ref-filter APIs. Before show_detac

[PATCH v3 4/8] branch: move 'current' check down to the presentation layer

2015-08-21 Thread Karthik Nayak
We check if given ref is the current branch in print_ref_list(). Move this check to print_ref_item() where it is checked right before printing. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 22 +

[PATCH v3 5/8] branch: drop non-commit error reporting

2015-08-21 Thread Karthik Nayak
Remove the error reporting variable to make the code easier to port over to using ref-filter APIs. This variable is not required as in ref-filter we already check for possible errors and report them. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off

[PATCH v3 2/8] branch: bump get_head_description() to the top

2015-08-21 Thread Karthik Nayak
This is a preperatory patch for 'roll show_detached HEAD into regular ref_list'. This patch moves get_head_description() to the top so that it can be used in print_ref_item(). Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak ---

[PATCH v3 1/8] branch: refactor width computation

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak Remove unnecessary variables from ref_list and ref_item which were used for width computation. This is to make ref_item similar to ref-filter's ref_array_item. This will ensure a smooth port of branch.c to use ref-filter APIs in further patches. Previously the maxwidth was co

[PATCH v3 0/8] port the filtering part of ref-filter to branch.c

2015-08-21 Thread Karthik Nayak
This is a follow up to porting tag.c to use ref-fitler APIs. v2 of this patch series can be found here: http://thread.gmane.org/gmane.comp.version-control.git/276147 Changes made in this series: * Improve comment in 3/8 and fix grammar in 5/8. * Fix the test in t1430 to check stderr for the broke

[PATCH v13 11/12] tag.c: implement '--format' option

2015-08-21 Thread Karthik Nayak
Implement the '--format' option provided by 'ref-filter'. This lets the user list tags 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 v13 06/12] ref-filter: support printing N lines from tag annotation

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak In 'tag.c' we can print N lines from the annotation of the tag using the '-n' option. Copy code from 'tag.c' to 'ref-filter' and modify 'ref-filter' to support printing of N lines from the annotation of tags. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-of

[PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-21 Thread Karthik Nayak
Implement an `align` atom which left-, middle-, or right-aligns the content between %(align:..) and %(end). It is followed by `:,`, where the `` is either left, right or middle and `` is the size of the area into which the content will be placed. If the content between %(align:) and %(end) is more

[PATCH v13 03/12] utf8: add function to align a string into given strbuf

2015-08-21 Thread Karthik Nayak
Add strbuf_utf8_align() which will align a given string into a strbuf as per given align_type and width. If the width is greater than the string length then no alignment is performed. Helped-by: Eric Sunshine Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak

[PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-21 Thread Karthik Nayak
Part of my GSoC project to port tag.c to use ref-filter APIs. This is a follow up to porting for-each-ref to use ref-filter APIs. Version 12 can be found here: thread.gmane.org/gmane.comp.version-control.git/276133 Changes since v12: * %(align)...%(end) now quote formats everything in between the

[PATCH v13 02/12] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-08-21 Thread Karthik Nayak
Introduce ref_formatting_state which will hold the formatted output strbuf instead of directly printing to stdout. This will help us in creating modifier atoms which modify the format specified before printing to stdout. Implement a stack machinery for ref_formatting_state, this allows us to push

[PATCH v13 08/12] ref-filter: add option to match literal pattern

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak Since 'ref-filter' only has an option to match path names add an option for plain fnmatch pattern-matching. This is to support the pattern matching options which are used in `git tag -l` and `git branch -l` where we can match patterns like `git tag -l foo*` which would match

[PATCH v13 07/12] ref-filter: add support to sort by version

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak Add support to sort by version using the "v:refname" and "version:refname" option. This is achieved by using the 'versioncmp()' function as the comparing function for qsort. This option is included to support sorting by versions in `git tag -l` which will eventually be ported

[PATCH v13 05/12] ref-filter: add option to filter out tags, branches and remotes

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak Add a function called 'for_each_reftype_fullpath()' to refs.{c,h} which iterates through each ref for the given path without trimming the path and also accounting for broken refs, if mentioned. Add 'filter_ref_kind()' in ref-filter.c to check the kind of ref being handled and

[PATCH v13 09/12] tag.c: use 'ref-filter' data structures

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'tag.c' to use 'ref-filter' APIs. This is a temporary step before porting 'tag.c' to use 'ref-filter' completely. As this is a temporary

[PATCH v13 12/12] tag.c: implement '--merged' and '--no-merged' options

2015-08-21 Thread Karthik Nayak
Use 'ref-filter' APIs to implement the '--merged' and '--no-merged' options into 'tag.c'. The '--merged' option lets the user to only list tags merged into the named commit. The '--no-merged' option lets the user to only list tags not merged into the named commit. If no object is provided it assum

[PATCH v13 10/12] tag.c: use 'ref-filter' APIs

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' APIs for iterating through refs, sorting and printing of refs. This removes most of the code used in 'tag.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out

[PATCH v13 01/12] ref-filter: move `struct atom_value` to ref-filter.c

2015-08-21 Thread Karthik Nayak
Since atom_value is only required for the internal working of ref-filter it doesn't belong in the public header. Helped-by: Eric Sunshine Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 5 + ref-filter.h | 5 + 2 files changed, 6

[PATCH v3] gc: save log from daemonized gc --auto and print it next time

2015-08-21 Thread Nguyễn Thái Ngọc Duy
While commit 9f673f9 (gc: config option for running --auto in background - 2014-02-08) helps reduce some complaints about 'gc --auto' hogging the terminal, it creates another set of problems. The latest in this set is, as the result of daemonizing, stderr is closed and all warnings are lost. This

[PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits

2015-08-21 Thread Nguyễn Thái Ngọc Duy
I renamed both "flags" and "touched_flags" fields while making this patch to make sure I was aware of how these flags were manipulated (besides DIFF_OPT* macros). So hopefully I didn't miss anything. Signed-off-by: Nguyễn Thái Ngọc Duy --- Resend to the right recipients. I screwed send-email up.

[PATCH 8/8] Resurrect "diff-lib.c: adjust position of i-t-a entries in diff"

2015-08-21 Thread Nguyễn Thái Ngọc Duy
The original commit d95d728aba06a34394d15466045cbdabdada58a2 was reverted in commit 78cc1a540ba127b13f2f3fd531777b57f3a9cd46 because we were (and still are) not ready for a new world order. A lot more investigation must be done to see what is impacted. See the 78cc1a5 for details. This patch takes

[PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits

2015-08-21 Thread Nguyễn Thái Ngọc Duy
I renamed both "flags" and "touched_flags" fields while making this patch to make sure I was aware of how these flags were manipulated (besides DIFF_OPT* macros). So hopefully I didn't miss anything. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 2 +- diff-lib.c | 4 ++-- diff

[PATCH 6/8] grep: make it clear i-t-a entries are ignored

2015-08-21 Thread Nguyễn Thái Ngọc Duy
The expression "!S_ISREG(ce)" covers i-t-a entries as well because ce->ce_mode would be zero then. I could make a comment saying that, but it's probably better just to comment with code, in case i-t-a entry content changes in future. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 2 +-

[PATCH 5/8] checkout(-index): do not checkout i-t-a entries

2015-08-21 Thread Nguyễn Thái Ngọc Duy
The cached blob of i-t-a entries are empty blob. By checkout, we delete the content we have. Don't do it. This is done higher up instead of inside checkout_entry() because we would have limited options in there: silently ignore, loudly ignore, die. At higher level we can do better reporting. For e

[PATCH 3/8] apply: fix adding new files on i-t-a entries

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Applying a patch that adds a file when that file is registered with "git add -N" will fail with message "already exists in index" because git-apply checks, sees those i-t-a entries and aborts. git-apply does not realize those are for bookkeeping only, they do not really exist in the index. This pat

[PATCH 4/8] apply: make sure check_preimage() does not leave empty file on error

2015-08-21 Thread Nguyễn Thái Ngọc Duy
The test case probably describes the test scenario the best. We have a patch to modify some file but the base file is gone. Because check_preimage() finds an index entry with the same old_name, it tries to restore the on-disk base file with cached content with checkout_target() and move on. If thi

[PATCH 1/8] blame: remove obsolete comment

2015-08-21 Thread Nguyễn Thái Ngọc Duy
That "someday" in the comment happened two years later in b65982b (Optimize "diff-index --cached" using cache-tree - 2009-05-20) Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 5 - 1 file changed, 5 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index 4db01c1..942f30

[PATCH 2/8] Add and use convenient macro ce_intent_to_add()

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/rm.c | 2 +- cache-tree.c | 2 +- cache.h | 1 + read-cache.c | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/rm.c b/builtin/rm.c index 80b972f..8829b09 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -211,7 +21

[PATCH 0/8] Resurrect "diff-lib.c: adjust position of i-t-a entries in diff"

2015-08-21 Thread Nguyễn Thái Ngọc Duy
On Thu, Jun 25, 2015 at 8:07 PM, Junio C Hamano wrote: >>> Perhaps a good and safe way forward to resurrect what d95d728a >>> wanted to do is to first add an option to tell run_diff_index() and >>> run_diff_files() which behaviour the caller wants to see, add that >>> only to the caller in wt-stat

[PATCH v2 5/5] clone: better error when --reference is a linked checkout

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin/clone.c b/builtin/clone.c index 836fb64..7a010bb 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -294,9 +294,14 @@ static int add_one_reference(struct st

[PATCH v2 0/5] fix local clone from a linked checkout

2015-08-21 Thread Nguyễn Thái Ngọc Duy
On Wed, Jul 15, 2015 at 8:25 PM, Duy Nguyen wrote: > On Wed, Jul 15, 2015 at 11:40:18AM +0200, Bjørnar Snoksrud wrote: >> I reported this before, but now I have a nice topic to hang it on - >> >> I have re-reproduced the bug using a build from master as of today, >> using the new worktree commands

[PATCH v2 2/5] enter_repo: avoid duplicating logic, use is_git_directory() instead

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/path.c b/path.c index a536ee3..7340e11 100644 --- a/path.c +++ b/path.c @@ -441,8 +441,7 @@ const char *enter_repo(const char *path, int strict) else if (chdir(path))

[PATCH v2 3/5] enter_repo: allow .git files in strict mode

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Strict mode is about not guessing where .git is. If the user points to a .git file, we know exactly where the target .git dir will be. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/path.c b/path.c index 7340e11..32d4ca

[PATCH v2 4/5] clone: allow --local from a linked checkout

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Noticed-by: Bjørnar Snoksrud Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 6 -- t/t2025-worktree-add.sh | 5 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 578da85..836fb64 100644 --- a/builtin/clone.c +++ b/b

[PATCH v2 1/5] path.c: delete an extra space

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.c b/path.c index 95acbaf..a536ee3 100644 --- a/path.c +++ b/path.c @@ -431,7 +431,7 @@ const char *enter_repo(const char *path, int strict) } if

Re: Where to report security vulnerabilities in git?

2015-08-21 Thread Junio C Hamano
On Fri, Aug 21, 2015 at 3:55 PM, Guido Vranken wrote: > germane exploitation details. I did find an older thread in the > archive addressing this question ( > http://thread.gmane.org/gmane.comp.version-control.git/260328/ ), but > because I'm unsure if those e-mail addresses are still relevant, I'

Re: Submodule, subtree, or something else?

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 3:47 PM, Jānis Rukšāns wrote: > Hello, > > > First of all, I apologise for the wall of text that follows; obviously I > am bad at this. > > My $DAYJOB is switching from Subversion to Git, primarily because of > it's distributed nature (we are scattered all across the globe)

Re: Where to report security vulnerabilities in git?

2015-08-21 Thread Stefan Beller
The addresses are still valid. (I think there was a plan to introduce a git-security@... but I am not sure if that happened.) > Current practice is to contact Junio C Hamano pobox.com>. > Cc-ing Jeff King peff.net> isn't a bad idea while at it. Just go for that. On Fri, Aug 21, 2015 at 3:55 P

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 12:44 PM, Jeff King wrote: > On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote: > >> The primary reason I suspect is because you sent to a wrong set of >> people. Submodule folks have largely been working in the scripted >> ones, and may not necessarily be the

Where to report security vulnerabilities in git?

2015-08-21 Thread Guido Vranken
List, I would like to report security vulnerabilities in git. Due to the sensitive nature of security-impacting bugs I would like to know if there's a dedicated e-mail address for this, so that the issues at play can be patched prior to a coordinated public disclosure of the germane exploitation d

Submodule, subtree, or something else?

2015-08-21 Thread Jānis Rukšāns
Hello, First of all, I apologise for the wall of text that follows; obviously I am bad at this. My $DAYJOB is switching from Subversion to Git, primarily because of it's distributed nature (we are scattered all across the globe), and the ease of branching and merging. One issue that has popped

Re: Which branch(es) contain certain commits? (was Re: (unknown))

2015-08-21 Thread Junio C Hamano
Ivan Chernyavsky writes: > But now I had a look on the source and I can see that builtin/branch.c > builds the list of references and prints them in a single place > (print_ref_list()) so I will have to split that function into two in > order to reuse existing functionality. > > Another problem i

Re: Minor bug with help.autocorrect.

2015-08-21 Thread Junio C Hamano
Jeff King writes: > I think the plan is: > > 1. squelch the warning message from the config code; even if we change > the config format to pager.*.command, we will have to support > pager.* for historical reasons. > > 2. introduce pager.*.command so that "git foo_bar" can use >

Re: [RFC/PATCH] contrib: teach completion about git-worktree options and arguments

2015-08-21 Thread Eric Sunshine
On Fri, Aug 21, 2015 at 4:49 PM, SZEDER Gábor wrote: > Quoting Junio C Hamano : >> Eric Sunshine writes: >>> On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine >>> wrote: Complete subcommands 'add' and 'prune', as well as their respective options --force, --detach, --dry-run, --verbose, an

[PATCH 3z/3] log: make '-p' imply '-m --cc'

2015-08-21 Thread Junio C Hamano
Junio C Hamano writes: > The latter was inspired by a recent discussion, most notably > >http://thread.gmane.org/gmane.comp.version-control.git/273937/focus=273988 > > but implements it with a much less UI impact. Tweaking "git log -p" > has a lot of fallout---interested parties can try it o

Which branch(es) contain certain commits? (was Re: (unknown))

2015-08-21 Thread Ivan Chernyavsky
17.08.2015, 20:49, "Junio C Hamano" : >  Duy Nguyen writes: > >>   On Wed, Aug 5, 2015 at 7:47 PM, Ivan Chernyavsky >> wrote: > >  That is a dangeous thought. I'd understand if it were internally >  two step process, i.e. (1) the first pass finds commits that hits >  the --grep criteria and th

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 1:47 PM, Junio C Hamano wrote: > > I do not think we are on the same wavelength. What I meant was to > do this: > > aq = xmalloc(...); > set up _everything_ in aq and make it a consistent state; > /* aq->first and aq->last are part of _everything_ i

[PoC PATCH] completion: support 'git worktree'

2015-08-21 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- > I wrote a completion function for 'git worktree' as well, turns out a week > or two before you posted this, but I never submitted it as it was way too > convoluted. Anyway, will send it in reply to this, just for reference. And here it is. >From the number of i

Re: [RFC/PATCH] contrib: teach completion about git-worktree options and arguments

2015-08-21 Thread SZEDER Gábor
Quoting Junio C Hamano : Eric Sunshine writes: On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine wrote: Complete subcommands 'add' and 'prune', as well as their respective options --force, --detach, --dry-run, --verbose, and --expire. Also complete 'refname' in "git worktree add [-b ] ".

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Junio C Hamano
Stefan Beller writes: >>> +struct task_queue *create_task_queue(unsigned max_threads) >>> +{ >>> + struct task_queue *aq = xmalloc(sizeof(*aq)); >>> + >>> +#ifndef NO_PTHREADS >>> + int i; >>> + if (!max_threads) >>> + aq->max_threads = online_cpus(); >>> + else >>> +

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Junio C Hamano
Jeff King writes: > On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote: > >> The primary reason I suspect is because you sent to a wrong set of >> people. Submodule folks have largely been working in the scripted >> ones, and may not necessarily be the ones who are most familiar with

Urgent, Dear Invited Author,

2015-08-21 Thread Olga Nikolova
Dear Invited Author, You have 6 days until August 25 for your Invited Paper in the WSEAS Conferences in Seoul, South Korea. We have just upgraded the role of Invited Speakers (see below). The extended version of the accepted papers will be published in our collaborating 44 ISI Journals. If Au

Re: [WIP/PATCH 3/3] submodule: helper to run foreach in parallel

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 12:23 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> +struct submodule_args { >> + const char *name; >> + const char *path; >> + const char *sha1; >> + const char *toplevel; >> + const char *prefix; >> + const char **cmd; >> + struct sub

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 12:51 PM, Jeff King wrote: > On Fri, Aug 21, 2015 at 12:48:23PM -0700, Stefan Beller wrote: > >> > Before even looking at the implementation, my first question would be >> > whether this pattern is applicable in several places in git (i.e., is it >> > worth the extra comple

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Jeff King
On Fri, Aug 21, 2015 at 12:48:23PM -0700, Stefan Beller wrote: > > Before even looking at the implementation, my first question would be > > whether this pattern is applicable in several places in git (i.e., is it > > worth the extra complexity of abstracting out in the first place). I > > think t

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 12:44 PM, Jeff King wrote: > On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote: > >> The primary reason I suspect is because you sent to a wrong set of >> people. Submodule folks have largely been working in the scripted >> ones, and may not necessarily be the

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Stefan Beller
On Fri, Aug 21, 2015 at 12:05 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> This adds functionality to do work in parallel. >> >> The whole life cycle of such a thread pool would look like >> >> struct task_queue * tq = create_task_queue(32); // no of threads >> for (...) >>

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Jeff King
On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote: > The primary reason I suspect is because you sent to a wrong set of > people. Submodule folks have largely been working in the scripted > ones, and may not necessarily be the ones who are most familiar with > the run-command infrast

Re: [PATCH 2/3] format_config: simplify buffer handling

2015-08-21 Thread Jeff King
On Fri, Aug 21, 2015 at 10:43:58AM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > I wonder if we can do this instead > > > > if (!omit_values) { > > - if (show_keys) > > + if (show_keys && value_) > > strbuf_addch(buf, key_delim); > > > >

Re: [WIP/PATCH 3/3] submodule: helper to run foreach in parallel

2015-08-21 Thread Junio C Hamano
Stefan Beller writes: > +struct submodule_args { > + const char *name; > + const char *path; > + const char *sha1; > + const char *toplevel; > + const char *prefix; > + const char **cmd; > + struct submodule_output *out; > + sem_t *mutex; > +}; I do not see what s

Re: [RFC PATCH 2/3] run-commands: add an async queue processor

2015-08-21 Thread Junio C Hamano
Stefan Beller writes: > This adds functionality to do work in parallel. > > The whole life cycle of such a thread pool would look like > > struct task_queue * tq = create_task_queue(32); // no of threads > for (...) > add_task(tq, process_one_item_function, item); // non blocking

[PATCH 4/3] builtin/log.c: minor reformat

2015-08-21 Thread Junio C Hamano
Two logical lines that were not overly long was split in the middle, which made them read worse. Signed-off-by: Junio C Hamano --- builtin/log.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 0cdd889..a491d3d 100644 --- a/builtin/log

Re: [PATCH v4] git-p4: fix faulty paths for case insensitive systems

2015-08-21 Thread Junio C Hamano
larsxschnei...@gmail.com writes: > From: Lars Schneider > > PROBLEM: > We run P4 servers on Linux and P4 clients on Windows. For an unknown > reason the file path for a number of files in P4 does not match the > directory path with respect to case sensitivity. > > E.g. `p4 files` might return > /

Re: [PATCH 2/3] format_config: simplify buffer handling

2015-08-21 Thread Junio C Hamano
Junio C Hamano writes: > I wonder if we can do this instead > > if (!omit_values) { > - if (show_keys) > + if (show_keys && value_) > strbuf_addch(buf, key_delim); > > though. That would eliminate the need for rolling back. No we cannot. "con

Re: [PATCH 2/3] format_config: simplify buffer handling

2015-08-21 Thread Junio C Hamano
Jeff King writes: > When formatting a config value into a strbuf, we may end > up stringifying it into a fixed-size buffer using sprintf, > and then copying that buffer into the strbuf. We can > eliminate the middle-man (and drop some calls to sprintf!) > by writing directly to the strbuf. > > Th

Re: [RFC/PATCH] contrib: teach completion about git-worktree options and arguments

2015-08-21 Thread Junio C Hamano
Eric Sunshine writes: > On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine > wrote: >> Complete subcommands 'add' and 'prune', as well as their respective >> options --force, --detach, --dry-run, --verbose, and --expire. Also >> complete 'refname' in "git worktree add [-b ] >> ". > > Ping[1]? > >

[PATCH v4] git-p4: fix faulty paths for case insensitive systems

2015-08-21 Thread larsxschneider
From: Lars Schneider PROBLEM: We run P4 servers on Linux and P4 clients on Windows. For an unknown reason the file path for a number of files in P4 does not match the directory path with respect to case sensitivity. E.g. `p4 files` might return //depot/path/to/file1 //depot/PATH/to/file2 If you

Re: [PATCH] Documentation/config: fix inconsistent label

2015-08-21 Thread Junio C Hamano
Andreas Schwab writes: > Change to in the description of > gc.*.reflogExpireUnreachable, since that is what the text refers to. > > Signed-off-by: Andreas Schwab > --- Makes sense. Thanks. > Documentation/config.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/D

Re: [BUG/PATCH] t9350-fast-export: Add failing test for symlink-to-directory

2015-08-21 Thread Anders Kaseorg
On Fri, 21 Aug 2015, Jeff King wrote: > - we may still have the opposite problem with renames. That is, a > rename is _also_ a deletion, but will go to the end. So I would > expect renaming the symlink "foo" to "bar" and then adding > "foo/world" would end up with: > >M 10064

Re: [PATCH 3/3] am: rename "struct tree_desc t" to "desc" for readability

2015-08-21 Thread Junio C Hamano
David Aguilar writes: > Signed-off-by: David Aguilar > --- > builtin/am.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Naming the tree_desc parameter given to unpack_trees() as "t" is (unfortunately) an established convention, just like we often use "i" and "j" in for() loop

Re: [PATCH 2/3] am: do not corrupt the index stat state

2015-08-21 Thread Junio C Hamano
David Aguilar writes: > Reported-by: Linus Torvalds > Signed-off-by: David Aguilar > @@ -1975,10 +1977,20 @@ static int clean_index(const unsigned char *head, > const unsigned char *remote) > > memset(&pathspec, 0, sizeof(pathspec)); > > + memset(&opts, 0, sizeof(opts)); > + o

Re: [PATCH] describe --contains: default to HEAD when no commit-ish is given

2015-08-21 Thread Junio C Hamano
SZEDER Gábor writes: > 'git describe --contains' doesn't default to HEAD when no commit is > given, and it doesn't produce any output, not even an error: > > ~/src/git ((v2.5.0))$ ./git describe --contains > ~/src/git ((v2.5.0))$ ./git describe --contains HEAD > v2.5.0^0 Good spotting. I t

Re: Minor bug with help.autocorrect.

2015-08-21 Thread Jeff King
On Fri, Aug 21, 2015 at 09:10:35AM -0700, Junio C Hamano wrote: > > $ git \#fetch > > error: invalid key: pager.#fetch > > error: invalid key: alias.#fetch > > git: '#fetch' is not a git command. See 'git --help'. > > > > Did you mean this? > > fetch > > Thanks. I somehow thought that we

Re: Minor bug with help.autocorrect.

2015-08-21 Thread Junio C Hamano
Bjørnar Snoksrud writes: > If you mis-type a git command starting with a non-letter, git > internals will spit out some errors at you. > > $ git 5fetch > error: invalid key: pager.5fetch > error: invalid key: alias.5fetch > git: '5fetch' is not a git command. See 'git --help'. > > Did you mean th

Re: [PATCH] describe: make '--always' fallback work after '--exact-match' failed

2015-08-21 Thread Junio C Hamano
SZEDER Gábor writes: > Quoting Junio C Hamano : > >> Well, that can be argued both ways. > ... > > 'git describe' errors out by default if it can't describe the given > commit. Yes. "describe" always fails when it cannot produce an acceptable description. And "--always" and "--exact-match" are

[PATCH] Documentation/config: fix inconsistent label

2015-08-21 Thread Andreas Schwab
Change to in the description of gc.*.reflogExpireUnreachable, since that is what the text refers to. Signed-off-by: Andreas Schwab --- Documentation/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 75ec02e.

Re: [PATCH v2 7/9] builtin/send-pack.c: Use option parsing API

2015-08-21 Thread Jeff King
On Wed, Aug 19, 2015 at 03:46:25PM -0400, Dave Borowitz wrote: > >> + unsigned dry_run = 0; > >> + unsigned send_mirror = 0; > >> + unsigned force_update = 0; > >> + unsigned quiet = 0; > >> + unsigned push_cert = 0; > >> + unsigned use_thin_pack = 0; > >> +

Re: [BUG/PATCH] t9350-fast-export: Add failing test for symlink-to-directory

2015-08-21 Thread Jeff King
On Wed, Aug 19, 2015 at 03:46:27PM -0400, Anders Kaseorg wrote: > git fast-export | git fast-import fails to preserve a commit that replaces > a symlink with a directory. Add a failing test case demonstrating this > bug. > > The fast-export output for the commit in question looks like > > c

git log date filter behavior with --date-order

2015-08-21 Thread Kirill Likhodedov
Hi, I’ve faced a strange behavior when filtering git log by date. When used with “--date-order” it gives significantly less results that when used without that option: # git log --pretty=oneline --remotes "--after=Wed May 20 23:00:00 MSK 2015" "--before=Fri May 22 00:00:00 MSK 2015" -- | wc -

[PATCH] describe --contains: default to HEAD when no commit-ish is given

2015-08-21 Thread SZEDER Gábor
'git describe --contains' doesn't default to HEAD when no commit is given, and it doesn't produce any output, not even an error: ~/src/git ((v2.5.0))$ ./git describe --contains ~/src/git ((v2.5.0))$ ./git describe --contains HEAD v2.5.0^0 Unlike other 'git describe' options, the '--contains

Re: [PATCH 7/7] submodule: implement `module_clone` as a builtin helper

2015-08-21 Thread Jeff King
On Mon, Aug 17, 2015 at 05:22:03PM -0700, Stefan Beller wrote: > +static int module_clone(int argc, const char **argv, const char *prefix) > [...] > + /* Redirect the worktree of the submodule in the superprojects config */ > + if (!is_absolute_path(sm_gitdir)) { > + char *s =

[PATCH v4 08/10] grep/pcre: support utf-8

2015-08-21 Thread Nguyễn Thái Ngọc Duy
In the previous change in this function, we add locale support for single-byte encodings only. It looks like pcre only supports utf-* as multibyte encodings, the others are left in the cold (which is fine). We need to enable PCRE_UTF8 so pcre can find character boundary correctly. It's needed for

[PATCH v4 10/10] diffcore-pickaxe: support case insensitive match on non-ascii

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Similar to the "grep -F -i" case, we can't use kws on icase search outside ascii range, so we quote the string and pass it to regcomp as a basic regexp and let regex engine deal with case sensitivity. The new test is put in t7812 instead of t4209-log-pickaxe because lib-gettext.sh might cause prob

[PATCH v4 09/10] diffcore-pickaxe: "share" regex error handling code

2015-08-21 Thread Nguyễn Thái Ngọc Duy
There's another regcomp code block coming in this function. By moving the error handling code out of this block, we don't have to add the same error handling code in the new block. Signed-off-by: Nguyễn Thái Ngọc Duy --- diffcore-pickaxe.c | 16 1 file changed, 8 insertions(+),

[PATCH v4 07/10] gettext: add is_utf8_locale()

2015-08-21 Thread Nguyễn Thái Ngọc Duy
This function returns true if git is running under an UTF-8 locale. pcre in the next patch will need this. is_encoding_utf8() is used instead of strcmp() to catch both "utf-8" and "utf8" suffixes. When built with no gettext support, we peek in several env variables to detect UTF-8. pcre library m

[PATCH v4 06/10] grep/pcre: prepare locale-dependent tables for icase matching

2015-08-21 Thread Nguyễn Thái Ngọc Duy
The default tables are usually built with C locale and only suitable for LANG=C or similar. This should make case insensitive search work correctly for all single-byte charsets. Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 8 ++-- grep.h

[PATCH v4 05/10] grep/icase: avoid kwsset when -F is specified

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Similar to the previous commit, we can't use kws on icase search outside ascii range. But we can't simply pass the pattern to regcomp/pcre like the previous commit because it may contain regex special characters, so we need to quote the regex first. To avoid misquote traps that could lead to undef

[PATCH v4 00/10] icase match on non-ascii

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Sorry it took more than a month for a simple reroll. Free time (with energy left) is rare these days. v4 adds system regex's icase support detection and only runs tests in these cases. This should fix test failures on Windows where compat regex does not support icase. Diff from v3 below diff --gi

[PATCH v4 01/10] grep: allow -F -i combination

2015-08-21 Thread Nguyễn Thái Ngọc Duy
-F means "no regex", not "case sensitive" so it should not override -i Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/grep.c b/builtin/grep.c index d04f440..2d392e9 100644 --- a/builtin/grep.c +++ b/builtin/grep.

[PATCH v4 03/10] test-regex: expose full regcomp() to the command line

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- test-regex.c | 56 ++-- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/test-regex.c b/test-regex.c index 0dc598e..3b5641c 100644 --- a/test-regex.c +++ b/test-regex.c @@ -1,19 +1,63 @@ #in

[PATCH v4 04/10] grep/icase: avoid kwsset on literal non-ascii strings

2015-08-21 Thread Nguyễn Thái Ngọc Duy
When we detect the pattern is just a literal string, we avoid heavy regex engine and use fast substring search implemented in kwsset.c. But kws uses git-ctype which is locale-independent so it does not know how to fold case properly outside ascii range. Let regcomp or pcre take care of this case in

[PATCH v4 02/10] grep: break down an "if" stmt in preparation for next changes

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grep.c b/grep.c index b58c7c6..bd32f66 100644 --- a/grep.c +++ b/grep.c @@ -403,9 +403,11 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt) p->wo

Re: [PATCH 2/3] format_config: simplify buffer handling

2015-08-21 Thread SZEDER Gábor
Quoting Jeff King : When formatting a config value into a strbuf, we may end up stringifying it into a fixed-size buffer using sprintf, and then copying that buffer into the strbuf. We can eliminate the middle-man (and drop some calls to sprintf!) by writing directly to the strbuf. The reason

Re: Unable to create temporary file '/var/git/tmv3-target-overlay.git/shallow_Un8ZOR': Permission denied

2015-08-21 Thread Joakim Tjernlund
On Fri, 2015-08-21 at 13:36 +0200, Joakim Tjernlund wrote: > I cannot push: > # > git push origin > Login for jo...@git.transmode.se > Password: > Counting objects: 7, done. > Delta compression using up to 4 threads. > Compressing objects: 100% (7/7), done. > Writing objects: 100% (7/7), 13.73 KiB

Unable to create temporary file '/var/git/tmv3-target-overlay.git/shallow_Un8ZOR': Permission denied

2015-08-21 Thread Joakim Tjernlund
I cannot push: # > git push origin Login for jo...@git.transmode.se Password: Counting objects: 7, done. Delta compression using up to 4 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% (7/7), 13.73 KiB | 0 bytes/s, done. Total 7 (delta 4), reused 0 (delta 0) fatal: Unable to

Re: [PATCH] describe: make '--always' fallback work after '--exact-match' failed

2015-08-21 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: 'git describe [...] --always' should always show the unique abbreviated object name as a fallback when the given commit cannot be described with the given set of options, see da2478dbb0 (describe --always: fall back to showing an abbreviated obje

  1   2   >