[RFC/PATCH 0/9] add options to ref-filter

2015-06-06 Thread Karthik Nayak
This is a follow up series to the one posted here http://thread.gmane.org/gmane.comp.version-control.git/270922 This patch series adds '--ponints-at', '--merged', '--no-merged' and '--contain' options to 'ref-filter' and uses these options in 'for-each-ref'. -- Regards, Karthik -- To

[RFC/PATCH 3/9] for-each-ref: add '--points-at' option

2015-06-06 Thread Karthik Nayak
Add the '--points-at' option provided by 'ref-filter'. The option lets the user to pick only refs which point to a particular commit. Add Documentation for the same. Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

[RFC/PATCH 4/9] parse-options: add parse_opt_merge_filter()

2015-06-06 Thread Karthik Nayak
Add 'parse_opt_merge_filter()' to parse '--merged' and '--no-merged' options and write MACROS for the same. Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak

[RFC/PATCH 2/9] ref-filter: implement '--points-at' option

2015-06-06 Thread Karthik Nayak
In 'tag -l' we have '--points-at' option which lets users list only tags which point to a particular commit, Implement this option in 'ref-filter.{c,h}' so that the other commands can benefit from this. Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder

[RFC/PATCH 6/9] for-each-ref: add '--merged' and '--no-merged' options

2015-06-06 Thread Karthik Nayak
Add the '--merged' and '--no-merged' options provided by 'ref-filter'. The '--merged' option lets the user to only list refs merged into the named commit. The '--no-merged' option lets the user to only list refs not merged into the named commit. Add documentation for the same. Based-on-patch-by:

[RFC/PATCH 8/9] ref-filter: add '--contains' option

2015-06-06 Thread Karthik Nayak
'tag -l' and 'branch -l' have two different ways of finding out if a certain ref contains a commit. Implement both these methods in ref-filter and give the caller of ref-filter API the option to pick which implementation to be used. 'branch -l' uses 'is_descendant_of()' from commit.c which is

[RFC/PATCH 7/9] parse-options.h: add macros for '--contains' option

2015-06-06 Thread Karthik Nayak
Add a macro for using the '--contains' option in parse-options.h also include an optional '--with' option macro which performs the same action as '--contains'. Make tag.c use this new macro Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

[RFC/PATCH 1/9] tag: libify parse_opt_points_at()

2015-06-06 Thread Karthik Nayak
Moving 'parse_opt_points_at()' from 'tag.c' to a common location, in preparation for using it in 'ref-filter'. Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak

[RFC/PATCH 9/9] for-each-ref: add '--contains' option

2015-06-06 Thread Karthik Nayak
Add the '--contains' option provided by 'ref-filter'. The '--contains' lists only refs which are contain the specific commit (HEAD of the branch if no commit give). Add documentation for the same. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

[RFC/PATCH 5/9] ref-filter: implement '--merged' and '--no-merged' options

2015-06-06 Thread Karthik Nayak
In 'branch -l' we have '--merged' option which only lists refs (branches) merged into the named commit and '--no-merged' option which only lists refs (branches) not merged into the named commit will be listed. Implement these two options in ref-filter.{c,h} so that other commands can benefit from

[WIP/PATCH v5 0/10] create ref-filter from for-each-ref

2015-06-06 Thread Karthik Nayak
Version for of this patch can be found here : http://www.mail-archive.com/git@vger.kernel.org/msg70280.html Changes in this version: * Rename functions to better suit the code. * implement filter_refs() * use FLEX_ARRAY for refname * other small changes -- Regards,

[WIP/PATCH v5 09/10] for-each-ref: introduce filter_refs()

2015-06-06 Thread Karthik Nayak
Introduce filter_refs() which will act as an API for users to call and provide a function which will iterate over a set of refs while filtering out the required refs. Currently this will wrap around ref_filter_handler(). Hence, ref_filter_handler is made file scope static. Helped-by: Junio C

[WIP/PATCH v5 10/10] ref-filter: make 'ref_array_item' use a FLEX_ARRAY for refname

2015-06-06 Thread Karthik Nayak
This would remove the need of using a pointer to store refname. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 7 --- ref-filter.h | 2 +- 2 files changed, 5

[WIP/PATCH v5 07/10] ref-filter: add 'ref-filter.h'

2015-06-06 Thread Karthik Nayak
This is step one of creating a common library for 'for-each-ref', 'branch -l' and 'tag -l'. This creates a header file with the functions and data structures that ref-filter will provide. We move the data structures created in for-each-ref to this header file. Mentored-by: Christian Couder

[WIP/PATCH v5 08/10] ref-filter: move code from 'for-each-ref'

2015-06-06 Thread Karthik Nayak
Move most of the code from 'for-each-ref' to 'ref-filter' to make it publicly available to other commands, this is to unify the code of 'tag -l', 'branch -l' and 'for-each-ref' so that they can share their implementations with each other. Add 'ref-filter' to the Makefile, this completes the

[WIP/PATCH v5 03/10] for-each-ref: rename 'refinfo' to 'ref_array_item'

2015-06-06 Thread Karthik Nayak
Rename 'refinfo' to 'ref_array_item' as a preparatory step for introduction of new structures in the forthcoming patch. Re-order the fields in 'ref_array_item' so that refname can be eventually converted to a FLEX_ARRAY. Make 'symref' a non const char pointer, so that the compiler doesn't throw

[WIP/PATCH v5 02/10] for-each-ref: clean up code

2015-06-06 Thread Karthik Nayak
In 'grab_single_ref()' remove the extra count variable 'cnt' and use the variable 'grab_cnt' of structure 'grab_ref_cbdata' directly instead. Change comment in 'struct ref_sort' to reflect changes in code. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

[WIP/PATCH v5 06/10] for-each-ref: rename some functions and make them public

2015-06-06 Thread Karthik Nayak
Rename some of the functions and make them publicly available. This is a preparatory step for moving code from 'for-each-ref' to 'ref-filter' to make meaningful, targeted services available to other commands via public APIs. Functions renamed are: parse_atom()-

[WIP/PATCH v5 05/10] for-each-ref: introduce 'ref_array_clear()'

2015-06-06 Thread Karthik Nayak
Introduce and implement 'ref_array_clear()' which will free all allocated memory for 'ref_array'. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/for-each-ref.c | 21

[WIP/PATCH v5 04/10] for-each-ref: introduce new structures for better organisation

2015-06-06 Thread Karthik Nayak
Introduce 'ref_filter_cbdata' which will hold 'ref_filter' (conditions to filter the refs on) and 'ref_array' (the array of ref_array_items). Modify the code to use these new structures. This is a preparatory patch to eventually move code from 'for-each-ref' to 'ref-filter' and make it publicly

[WIP/PATCH v5 01/10] for-each-ref: extract helper functions out of grab_single_ref()

2015-06-06 Thread Karthik Nayak
Extract two helper functions out of grab_single_ref(). Firstly, new_refinfo() which is used to allocate memory for a new refinfo structure and copy the objectname, refname and flag to it. Secondly, match_name_as_path() which when given an array of patterns and the refname checks if the refname

[PATCH v6 04/11] for-each-ref: introduce new structures for better organisation

2015-06-06 Thread Karthik Nayak
Introduce 'ref_filter_cbdata' which will hold 'ref_filter' (conditions to filter the refs on) and 'ref_array' (the array of ref_array_items). Modify the code to use these new structures. This is a preparatory patch to eventually move code from 'for-each-ref' to 'ref-filter' and make it publicly

[PATCH v6 02/11] for-each-ref: clean up code

2015-06-06 Thread Karthik Nayak
In 'grab_single_ref()' remove the extra count variable 'cnt' and use the variable 'grab_cnt' of structure 'grab_ref_cbdata' directly instead. Change comment in 'struct ref_sort' to reflect changes in code. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

[PATCH v6 01/11] for-each-ref: extract helper functions out of grab_single_ref()

2015-06-06 Thread Karthik Nayak
Extract two helper functions out of grab_single_ref(). Firstly, new_refinfo() which is used to allocate memory for a new refinfo structure and copy the objectname, refname and flag to it. Secondly, match_name_as_path() which when given an array of patterns and the refname checks if the refname

[PATCH v6 09/11] ref-filter: move code from 'for-each-ref'

2015-06-06 Thread Karthik Nayak
Move most of the code from 'for-each-ref' to 'ref-filter' to make it publicly available to other commands, this is to unify the code of 'tag -l', 'branch -l' and 'for-each-ref' so that they can share their implementations with each other. Add 'ref-filter' to the Makefile, this completes the

[PATCH v6 05/11] for-each-ref: introduce 'ref_array_clear()'

2015-06-06 Thread Karthik Nayak
Introduce and implement 'ref_array_clear()' which will free all allocated memory for 'ref_array'. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/for-each-ref.c | 21

[PATCH v6 06/11] for-each-ref: rename some functions and make them public

2015-06-06 Thread Karthik Nayak
Rename some of the functions and make them publicly available. This is a preparatory step for moving code from 'for-each-ref' to 'ref-filter' to make meaningful, targeted services available to other commands via public APIs. Functions renamed are: parse_atom()-

[PATCH v6 08/11] ref-filter: add 'ref-filter.h'

2015-06-06 Thread Karthik Nayak
This is step one of creating a common library for 'for-each-ref', 'branch -l' and 'tag -l'. This creates a header file with the functions and data structures that ref-filter will provide. We move the data structures created in for-each-ref to this header file. Mentored-by: Christian Couder

[PATCH 1/6] am --skip: revert changes introduced by failed 3way merge

2015-06-06 Thread Paul Tan
Even when a merge conflict occurs with am --3way, the index will be modified with the results of any succesfully merged files (such as a new file). These changes to the index will not be reverted with a git read-tree --reset -u HEAD HEAD, as git read-tree will not be aware of how the current index

[PATCH 2/6] am -3: support 3way merge on unborn branch

2015-06-06 Thread Paul Tan
While on an unborn branch, git am -3 will fail to do a threeway merge as it references HEAD as our tree, but HEAD does not point to a valid tree. Fix this by using an empty tree as our tree when we are on an unborn branch. Signed-off-by: Paul Tan pyoka...@gmail.com --- git-am.sh | 3

[PATCH 5/6] am --abort: support aborting to unborn branch

2015-06-06 Thread Paul Tan
When git-am is first run on an unborn branch, no ORIG_HEAD is created. As such, any applied commits will remain even after a git am --abort. To be consistent with the behavior of git am --abort when it is not run from an unborn branch, we empty the index, and then destroy the branch pointed to by

[PATCH 6/6] am --abort: keep unrelated commits on unborn branch

2015-06-06 Thread Paul Tan
Since 7b3b7e3 (am --abort: keep unrelated commits since the last failure and warn, 2010-12-21), git-am would refuse to rewind HEAD if commits were made since the last git-am failure. This check was implemented in safe_to_abort(), which checked to see if HEAD's hash matched the abort-safety file.

[PATCH 4/6] am --abort: revert changes introduced by failed 3way merge

2015-06-06 Thread Paul Tan
Even when a merge conflict occurs with am --3way, the index will be modified with the results of any successfully merged files. These changes to the index will not be reverted with a git read-tree --reset -u HEAD ORIG_HEAD, as git read-tree will not be aware of how the current index differs from

[PATCH 3/6] am --skip: support skipping while on unborn branch

2015-06-06 Thread Paul Tan
When git am --skip is run, git am will copy HEAD's tree entries to the index with git reset HEAD. However, on an unborn branch, HEAD does not point to a tree, so git reset HEAD will fail. Fix this by treating HEAD as en empty tree when we are on an unborn branch. Signed-off-by: Paul Tan

[PATCH 0/6] am --skip/--abort: improve index/worktree cleanup

2015-06-06 Thread Paul Tan
Currently git-am attempts to clean up the index/worktree when skipping or aborting, but does not do it very well: * While it discards conflicted index entries, it does not remove any other modifications made to the index due to a previous threeway merge. * It expects HEAD/ORIG_HEAD to exist,

Re: [WIP/PATCH v5 0/10] create ref-filter from for-each-ref

2015-06-06 Thread Christian Couder
On Sat, Jun 6, 2015 at 9:04 AM, Karthik Nayak karthik@gmail.com wrote: Version for of this patch can be found here : http://www.mail-archive.com/git@vger.kernel.org/msg70280.html Changes in this version: * Rename functions to better suit the code. * implement filter_refs() *

Re: [WIP/PATCH v5 0/10] create ref-filter from for-each-ref

2015-06-06 Thread Karthik Nayak
On 06/06/2015 03:10 PM, Christian Couder wrote: On Sat, Jun 6, 2015 at 9:04 AM, Karthik Nayak karthik@gmail.com wrote: Version for of this patch can be found here : http://www.mail-archive.com/git@vger.kernel.org/msg70280.html Changes in this version: * Rename functions to better

[PATCH v6 0/11] create ref-filter from for-each-ref

2015-06-06 Thread Karthik Nayak
Version four of this patch can be found here : http://www.mail-archive.com/git@vger.kernel.org/msg70280.html v5 : http://www.mail-archive.com/git@vger.kernel.org/msg70888.html Changes in v5: *Rename functions to better suit the code. *implement filter_refs() *use FLEX_ARRAY for

Re: [WIP/PATCH v5 0/10] create ref-filter from for-each-ref

2015-06-06 Thread Karthik Nayak
On 06/06/2015 12:34 PM, Karthik Nayak wrote: Version for of this patch can be found here : http://www.mail-archive.com/git@vger.kernel.org/msg70280.html Changes in this version: *Rename functions to better suit the code. *implement filter_refs() *use FLEX_ARRAY for refname *

[PATCH v6 11/11] ref-filter: make 'ref_array_item' use a FLEX_ARRAY for refname

2015-06-06 Thread Karthik Nayak
This would remove the need of using a pointer to store refname. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 7 --- ref-filter.h | 2 +- 2 files changed, 5

[PATCH v6 10/11] for-each-ref: introduce filter_refs()

2015-06-06 Thread Karthik Nayak
Introduce filter_refs() which will act as an API for users to call and provide a function which will iterate over a set of refs while filtering out the required refs. Currently this will wrap around ref_filter_handler(). Hence, ref_filter_handler is made file scope static. Helped-by: Junio C

[PATCH v6 07/11] for-each-ref: rename variables called sort to sorting

2015-06-06 Thread Karthik Nayak
Rename all the variables called sort to sorting to match the function name changes made in the previous patch. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com ---

[PATCH/RFC v2 5/5] send-email: refactor address list process

2015-06-06 Thread Remi Lespinet
Simplify code by creating a function to transform list of email lists (comma separated, with aliases ...) into a simple list of valid email addresses. Signed-off-by: Remi Lespinet remi.lespi...@ensimag.grenoble-inp.fr --- I'm not sure about the name of the function... git-send-email.perl | 28

[PATCH/RFC v2 3/5] t9001-send-email: refactor header variable fields replacement

2015-06-06 Thread Remi Lespinet
Create a function which replaces Date, Message-Id and X-Mailer lines generated by git-send-email by a specific string Date:.*$ - Date: DATE-STRING Message-Id:.*$ - Message-Id: MESSAGE-ID-STRING X-Mailer:.*$ - X-Mailer: X-MAILER-STRING This is a preparatory for the next commit.

[PATCH/RFC v2 2/5] send-email: allow aliases in patch header and command script outputs

2015-06-06 Thread Remi Lespinet
Interpret aliases in: - Header fields of patches generated by git format-patch (using --to, --cc, --add-header for example) or manually modified. Example of fields in header: To: alias1 Cc: alias2 Cc: alias3 - Outputs of command scripts specified by --cc-cmd

[PATCH/RFC v2 4/5] send-email: allow multiple emails using --cc, --to and --bcc

2015-06-06 Thread Remi Lespinet
From: Jorge Juan Garcia Garcia jorge-juan.garcia-gar...@ensimag.imag.fr Accept a list of emails separated by commas in flags --cc, --to and --bcc. Multiple addresses can already be given by using these options multiple times, but it is more convenient to allow cutting-and-pasting a list of

[PATCH/RFC v2 1/5] t9001-send-email: move script creation in a setup test

2015-06-06 Thread Remi Lespinet
Move the creation of the scripts used in to-cmd and cc-cmd tests in a setup test to make them available for later tests. This will be used in the next commit. Signed-off-by: Remi Lespinet remi.lespi...@ensimag.grenoble-inp.fr --- t/t9001-send-email.sh | 15 +-- 1 file changed, 9

[PATCH v2 1/2] t5520-pull: Simplify --rebase with dirty tree test

2015-06-06 Thread Kevin Daudt
Simplify the test case for testing git aborts the pull --rebase when the work tree is dirty. Signed-off-by: Kevin Daudt m...@ikke.info Helped-by: Paul Tan pyoka...@gmail.com --- This is a preparation for the next pathch. Changes since v1: - Moved the tests just belof the first --rebase test -

[PATCH v2 2/2] pull: allow dirty tree when rebase.autostash enabled

2015-06-06 Thread Kevin Daudt
From: Kevin Daudt compufr...@gmail.com rebase learned to stash changes when it encounters a dirty work tree, but git pull --rebase does not. Only verify if the working tree is dirty when rebase.autostash is not enabled. Signed-off-by: Kevin Daudt m...@ikke.info Helped-by: Paul Tan

[PATCH] utf8.c: print warning about disabled iconv

2015-06-06 Thread Max Kirillov
It is an allowed compile-time option to build git without iconv support. Resulting build almost always functions correctly, and never displays that it is missing anything, but reencode_string_len() just never modifies its input. This gives undesirable result that returned data or even data written

Re: [PATCH/RFCv2 2/2] git rebase -i: warn about removed commits

2015-06-06 Thread Remi Galan Alfonso
I'm going to try to change the die_abort in this patch by a die, so that the user can use rebase --edit-todo afterward. This way, adding the checking on the SHA-1 for the 'drop' command (discussed in 1/2) (and also maybe the other commands requiring a correct SHA-1 corresponding to a commit) to

Git on tomcat via LDAP

2015-06-06 Thread Simon
Hi All, I am Simon working for VISA. I am new to Git and planning to migrate the projects from ClearCase. Could anyone share the steps to configure git over http on Tomcat and enable the authentication through ldap to access the repositories? Cheers, Simon Sent from my iPhone-- To

Re: Submodules as first class citizens (was Re: Moving to subtrees for plugins?)

2015-06-06 Thread Luca Milanesio
Thank you Phil, you anticipated me :-) Luca. On 6 Jun 2015, at 18:49, Phil Hord phil.h...@gmail.com wrote: On Fri, Jun 5, 2015, 2:58 AM lucamilanesio luca.milane...@gmail.com wrote: Some devs of my Team complained that with submodules it is difficult to see the “full picture” of the

Submodules as first class citizens (was Re: Moving to subtrees for plugins?)

2015-06-06 Thread Phil Hord
On Fri, Jun 5, 2015, 2:58 AM lucamilanesio luca.milane...@gmail.com wrote: Some devs of my Team complained that with submodules it is difficult to see the “full picture” of the difference between two SHA1 on the root project, as the submodules would just show as different SHA1s. When you