Re: [PATCH v8 0/11] Create ref-filter from for-each-ref

2015-06-15 Thread Junio C Hamano
karthik nayak karthik@gmail.com writes:

 The previous version of the patch can be found at :
 http://thread.gmane.org/gmane.comp.version-control.git/271423

 Changes :
 * Removed an unnecessary commit (v7 3/12)
 * Change a comment in 01/11 (v8)

 Total changes :

  Makefile   |1 +
  builtin/for-each-ref.c | 1108
 +++---
  ref-filter.c   | 1101
 +
  ref-filter.h   |   74 
  4 files changed, 1195 insertions(+), 1089 deletions(-)

This round looks good enough to build on top by merging more
interesting bits from tags and branches ;-)  Let's conclude
this series at this round and then incrementally fix if there
is any remaining nits discovered later.

Thanks all.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/11] Create ref-filter from for-each-ref

2015-06-15 Thread karthik nayak
On Tue, Jun 16, 2015 at 12:19 AM, Junio C Hamano gits...@pobox.com wrote:
 karthik nayak karthik@gmail.com writes:

 The previous version of the patch can be found at :
 http://thread.gmane.org/gmane.comp.version-control.git/271423

 Changes :
 * Removed an unnecessary commit (v7 3/12)
 * Change a comment in 01/11 (v8)

 Total changes :

  Makefile   |1 +
  builtin/for-each-ref.c | 1108
 +++---
  ref-filter.c   | 1101
 +
  ref-filter.h   |   74 
  4 files changed, 1195 insertions(+), 1089 deletions(-)

 This round looks good enough to build on top by merging more
 interesting bits from tags and branches ;-)  Let's conclude
 this series at this round and then incrementally fix if there
 is any remaining nits discovered later.

 Thanks all.

Sounds good, thanks for all the suggestions everyone.

-- 
Regards,
Karthik Nayak
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/11] Create ref-filter from for-each-ref

2015-06-14 Thread karthik nayak
On Sun, Jun 14, 2015 at 1:34 PM, Matthieu Moy
matthieu@grenoble-inp.fr wrote:
 karthik nayak karthik@gmail.com writes:

 The previous version of the patch can be found at :
 http://thread.gmane.org/gmane.comp.version-control.git/271423

 Changes :
 * Removed an unnecessary commit (v7 3/12)
 * Change a comment in 01/11 (v8)

 And change the order of parameters in ref_filter. More precisely the
 diff with v7 is the following, and it looks good to me:

 diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
 index e2f15e6..7919206 100644
 --- a/builtin/for-each-ref.c
 +++ b/builtin/for-each-ref.c
 @@ -58,7 +58,7 @@ int cmd_for_each_ref(int argc, const char **argv, const 
 char *prefix)
 memset(array, 0, sizeof(array));
 memset(filter, 0, sizeof(filter));
 filter.name_patterns = argv;
 -   filter_refs(array, FILTER_REFS_ALL | FILTER_REFS_INCLUDE_BROKEN, 
 filter);
 +   filter_refs(array, filter, FILTER_REFS_ALL | 
 FILTER_REFS_INCLUDE_BROKEN);
 ref_array_sort(sorting, array);

 if (!maxcount || array.nr  maxcount)
 diff --git a/ref-filter.c b/ref-filter.c
 index 310ecd6..43502a4 100644
 --- a/ref-filter.c
 +++ b/ref-filter.c
 @@ -818,10 +818,10 @@ static void get_ref_atom_value(struct ref_array_item 
 *ref, int atom, struct atom
  }

  /*
 - * Return 1 if the refname matches with one of the patterns,
 - * otherwise 0.  The patterns can be literal prefix (e.g. a
 - * refname refs/heads/master matches a pattern refs/heads/)
 - * or a wildcard (e.g. the same ref matches refs/heads/m*,too).
 + * Return 1 if the refname matches one of the patterns, otherwise 0.
 + * A pattern can be path prefix (e.g. a refname refs/heads/master
 + * matches a pattern refs/heads/) or a wildcard (e.g. the same ref
 + * matches refs/heads/m*,too).
   */
  static int match_name_as_path(const char **pattern, const char *refname)
  {
 @@ -912,7 +912,7 @@ void ref_array_clear(struct ref_array *array)
   * as per the given ref_filter structure and finally store the
   * filtered refs in the ref_array structure.
   */
 -int filter_refs(struct ref_array *array, unsigned int type, struct 
 ref_filter *filter)
 +int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned 
 int type)
  {
 struct ref_filter_cbdata ref_cbdata;

 diff --git a/ref-filter.h b/ref-filter.h
 index 6ab2a75..6997984 100644
 --- a/ref-filter.h
 +++ b/ref-filter.h
 @@ -23,7 +23,7 @@ struct atom_value {

  struct ref_sorting {
 struct ref_sorting *next;
 -   int atom; /* index into 'struct atom_value *' array */
 +   int atom; /* index into used_atom array (internal) */
 unsigned reverse : 1;
  };

 @@ -55,7 +55,7 @@ struct ref_filter_cbdata {
   * as per the given ref_filter structure and finally store the
   * filtered refs in the ref_array structure.
   */
 -int filter_refs(struct ref_array *array, unsigned int type, struct 
 ref_filter *filter);
 +int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned 
 int type);
  /*  Clear all memory allocated to ref_array */
  void ref_array_clear(struct ref_array *array);
  /*  Parse format string and sort specifiers */

 --
 Matthieu Moy
 http://www-verimag.imag.fr/~moy/

Thanks for summing it up.

-- 
Regards,
Karthik Nayak
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/11] Create ref-filter from for-each-ref

2015-06-14 Thread Matthieu Moy
karthik nayak karthik@gmail.com writes:

 The previous version of the patch can be found at :
 http://thread.gmane.org/gmane.comp.version-control.git/271423

 Changes :
 * Removed an unnecessary commit (v7 3/12)
 * Change a comment in 01/11 (v8)

And change the order of parameters in ref_filter. More precisely the
diff with v7 is the following, and it looks good to me:

diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index e2f15e6..7919206 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -58,7 +58,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char 
*prefix)
memset(array, 0, sizeof(array));
memset(filter, 0, sizeof(filter));
filter.name_patterns = argv;
-   filter_refs(array, FILTER_REFS_ALL | FILTER_REFS_INCLUDE_BROKEN, 
filter);
+   filter_refs(array, filter, FILTER_REFS_ALL | 
FILTER_REFS_INCLUDE_BROKEN);
ref_array_sort(sorting, array);
 
if (!maxcount || array.nr  maxcount)
diff --git a/ref-filter.c b/ref-filter.c
index 310ecd6..43502a4 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -818,10 +818,10 @@ static void get_ref_atom_value(struct ref_array_item 
*ref, int atom, struct atom
 }
 
 /*
- * Return 1 if the refname matches with one of the patterns,
- * otherwise 0.  The patterns can be literal prefix (e.g. a
- * refname refs/heads/master matches a pattern refs/heads/)
- * or a wildcard (e.g. the same ref matches refs/heads/m*,too).
+ * Return 1 if the refname matches one of the patterns, otherwise 0.
+ * A pattern can be path prefix (e.g. a refname refs/heads/master
+ * matches a pattern refs/heads/) or a wildcard (e.g. the same ref
+ * matches refs/heads/m*,too).
  */
 static int match_name_as_path(const char **pattern, const char *refname)
 {
@@ -912,7 +912,7 @@ void ref_array_clear(struct ref_array *array)
  * as per the given ref_filter structure and finally store the
  * filtered refs in the ref_array structure.
  */
-int filter_refs(struct ref_array *array, unsigned int type, struct ref_filter 
*filter)
+int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned 
int type)
 {
struct ref_filter_cbdata ref_cbdata;
 
diff --git a/ref-filter.h b/ref-filter.h
index 6ab2a75..6997984 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -23,7 +23,7 @@ struct atom_value {
 
 struct ref_sorting {
struct ref_sorting *next;
-   int atom; /* index into 'struct atom_value *' array */
+   int atom; /* index into used_atom array (internal) */
unsigned reverse : 1;
 };
 
@@ -55,7 +55,7 @@ struct ref_filter_cbdata {
  * as per the given ref_filter structure and finally store the
  * filtered refs in the ref_array structure.
  */
-int filter_refs(struct ref_array *array, unsigned int type, struct ref_filter 
*filter);
+int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned 
int type);
 /*  Clear all memory allocated to ref_array */
 void ref_array_clear(struct ref_array *array);
 /*  Parse format string and sort specifiers */

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v8 0/11] Create ref-filter from for-each-ref

2015-06-13 Thread karthik nayak
The previous version of the patch can be found at :
http://thread.gmane.org/gmane.comp.version-control.git/271423

Changes :
* Removed an unnecessary commit (v7 3/12)
* Change a comment in 01/11 (v8)

Total changes :

 Makefile   |1 +
 builtin/for-each-ref.c | 1108
+++---
 ref-filter.c   | 1101
+
 ref-filter.h   |   74 
 4 files changed, 1195 insertions(+), 1089 deletions(-)

-- 
Regards,
Karthik Nayak
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html