GSOC: Unify the commands `git tag -l`, `git brach -l` and `git for-each-ref`

2015-08-22 Thread Karthik Nayak
Hello All, As part of GSoC I'm working on the Unification of 'for-each-ref', 'tag -l' and 'branch -l'. Current Progress: 1. Building ref-filter.{c,h} from for-each-ref. This is the process of creating an initial library for the unification by moving most of the code from for-each-ref to

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

2015-08-22 Thread Ivan Chernyavsky
22.08.2015, 01:39, Junio C Hamano gits...@pobox.com:  Ivan Chernyavsky campo...@yandex.ru writes:   Another problem is that builtin/branch.c currently does not use   setup_revisions(), so I'll have to hook it there as well.  Heh, you say problem above, but I do not think it is a problem  

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

2015-08-22 Thread Ivan Chernyavsky
22.08.2015, 12:19, Ivan Chernyavsky campo...@yandex.ru:   One thing I'm worried about is that git-branch already has option --all. So we'll get a semantics conflict with setup_revisions() (all branches vs all refs). This will have to be treated carefully, e.g. retrace and fix effects of

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

2015-08-22 Thread Karthik Nayak
On Sat, Aug 22, 2015 at 2:49 PM, Ivan Chernyavsky campo...@yandex.ru wrote Note that branch --list, tag --list and for-each-ref are being revamped to share more internal code. If you want to pursue this, you probably would want to build on top of that effort once it is done. That way, you

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

2015-08-22 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 p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

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

2015-08-22 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 p...@peff.net Mentored-by: Christian Couder

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

2015-08-22 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

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

2015-08-22 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

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

2015-08-22 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 p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu

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

2015-08-22 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 christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr

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

2015-08-22 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

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

2015-08-22 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.

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

2015-08-22 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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.

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

2015-08-22 Thread Luke Diamand
Lars - thanks for persisting with this! I'm still trying to fully understand what's going on here - can you point out where I've got it wrong below please! The server is on Linux, and is case-sensitive. For whatever reason (probably people committing changes on Windows in the first place) we've

[PATCH 3/3] archive-zip: support more than 65535 entries

2015-08-22 Thread René Scharfe
Support more than 65535 entries cleanly by writing a zip64 end of central directory record (with a 64-bit field for the number of entries) before the usual end of central directory record (which contains only a 16-bit field). InfoZIP's zip does the same. Archives with 65535 or less entries are

[PATCH 2/3] archive-zip: use a local variable to store the creator version

2015-08-22 Thread René Scharfe
Use a simpler conditional right next to the code which makes a higher creator version necessary -- namely symlink handling and support for executable files -- instead of a long line with a ternary operator. The resulting code has more lines but is simpler and allows reuse of the value easily.

[PATCH 1/3] t5004: test ZIP archives with many entries

2015-08-22 Thread René Scharfe
A ZIP file directory has a 16-bit field for the number of entries it contains. There are 64-bit extensions to deal with that. Demonstrate that git archive --format=zip currently doesn't use them and instead overflows the field. InfoZIP's unzip doesn't care about this field and extracts all

[PATCH v5 0/2] Worktree: for-each function and list command

2015-08-22 Thread Michael Rappazzo
Changes since v4: - reduced memory usage by reusing string buffer variables - re-scoped variables in the for-each function - added tests for 'worktree list' with bare repos Notes from previous discussion: - The following snippet: + /* If the common_dir DOES NOT end with '/.git', then it

[PATCH v5 2/2] worktree: add 'list' command

2015-08-22 Thread Michael Rappazzo
'git worktree list' uses the for_each_worktree function to iterate, and outputs in the format: 'worktree (short-ref)' Signed-off-by: Michael Rappazzo rappa...@gmail.com --- Documentation/git-worktree.txt | 11 +- builtin/worktree.c | 55

[PATCH v5 1/2] worktree: add 'for_each_worktree' function

2015-08-22 Thread Michael Rappazzo
for_each_worktree iterates through each worktree and invokes a callback function. The main worktree (if not bare) is always encountered first, followed by worktrees created by `git worktree add`. If the callback function returns a non-zero value, iteration stops, and the callback's return value

Re: [PATCH 1/3] t5004: test ZIP archives with many entries

2015-08-22 Thread Eric Sunshine
On Sat, Aug 22, 2015 at 3:06 PM, René Scharfe l@web.de wrote: A ZIP file directory has a 16-bit field for the number of entries it contains. There are 64-bit extensions to deal with that. Demonstrate that git archive --format=zip currently doesn't use them and instead overflows the

[PATCH] am: terminate state files with a newline

2015-08-22 Thread Paul Tan
On Thu, Aug 20, 2015 at 11:40:20AM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: The format of the files '.git/rebase-apply/{next,last}' changed slightly with the recent builtin 'git am' conversion: while these files were newline-terminated when written by the

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

2015-08-22 Thread Karthik Nayak
On Sat, Aug 22, 2015 at 9:21 PM, Christian Couder christian.cou...@gmail.com wrote: On Sat, Aug 22, 2015 at 8:51 AM, Karthik Nayak karthik@gmail.com wrote: The test t1430 'git branch shows badly named ref' has been changed to check the stderr for the warning regarding the broken ref. This

[PATCH] Fix `git rev-list --show-notes HEAD` when there are no notes

2015-08-22 Thread Johannes Schindelin
The `format_display_notes()` function clearly assumes that the data structure holding the notes has been initialized already, i.e. that the `display_notes_trees` variable is no longer `NULL`. However, when there are no notes whatsoever, this variable is still `NULL`, even after initialization.

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

2015-08-22 Thread Christian Couder
On Sat, Aug 22, 2015 at 8:51 AM, Karthik Nayak karthik@gmail.com wrote: The test t1430 'git branch shows badly named ref' has been changed to check the stderr for the warning regarding the broken ref. This is done as ref-filter throws a warning for broken refs rather than directly

Re: [PATCH] Fix `git rev-list --show-notes HEAD` when there are no notes

2015-08-22 Thread Johan Herland
On Sat, Aug 22, 2015 at 5:14 PM, Johannes Schindelin johannes.schinde...@gmx.de wrote: The `format_display_notes()` function clearly assumes that the data structure holding the notes has been initialized already, i.e. that the `display_notes_trees` variable is no longer `NULL`. However, when