Re: [PATCH v2 03/10] ref-filter: support printing N lines from tag annotation

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2 03/10] ref-filter: support printing N lines from tag annotation

From: Matthieu Moy <hidden>
Date: 2016-06-15 23:05:43

Karthik Nayak [off-list ref] writes:
In 'tag.c' we can print N lines from the annotation of the tag
using the '-n<num>' option.
Not only annotation of the tag, but also from the commit message for
lightweight tags.
quoted hunk
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -185,6 +185,10 @@ static enum contains_result contains(struct commit *candidate,
 	return contains_test(candidate, want);
 }
 
+/*
+ * Currently dupplicated in ref-filter, will eventually be removed as
dupplicated -> duplicated.
quoted hunk
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -55,6 +55,7 @@ struct ref_filter {
 	struct commit *merge_commit;
 
 	unsigned int with_commit_tag_algo : 1;
+	unsigned int lines;
 };
 
 struct ref_filter_cbdata {
@@ -87,7 +88,7 @@ int verify_ref_format(const char *format);
 /*  Sort the given ref_array as per the ref_sorting provided */
 void ref_array_sort(struct ref_sorting *sort, struct ref_array *array);
 /*  Print the ref using the given format and quote_style */
-void show_ref_array_item(struct ref_array_item *info, const char *format, int quote_style);
+void show_ref_array_item(struct ref_array_item *info, const char *format, int quote_style, unsigned int lines);
I would add "If lines > 0, prints the first 'lines' no of lines of the
object pointed to" or so to the docstring.

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

Re: [PATCH v2 03/10] ref-filter: support printing N lines from tag annotation

From: Karthik Nayak <hidden>
Date: 2016-06-15 23:05:44

On Thu, Jul 9, 2015 at 6:37 PM, Matthieu Moy
[off-list ref] wrote:
Karthik Nayak [off-list ref] writes:
quoted
In 'tag.c' we can print N lines from the annotation of the tag
using the '-n<num>' option.
Not only annotation of the tag, but also from the commit message for
lightweight tags.
will do.
quoted
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -185,6 +185,10 @@ static enum contains_result contains(struct commit *candidate,
      return contains_test(candidate, want);
 }

+/*
+ * Currently dupplicated in ref-filter, will eventually be removed as
dupplicated -> duplicated.
Thanks :)
quoted
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -55,6 +55,7 @@ struct ref_filter {
      struct commit *merge_commit;

      unsigned int with_commit_tag_algo : 1;
+     unsigned int lines;
 };

 struct ref_filter_cbdata {
@@ -87,7 +88,7 @@ int verify_ref_format(const char *format);
 /*  Sort the given ref_array as per the ref_sorting provided */
 void ref_array_sort(struct ref_sorting *sort, struct ref_array *array);
 /*  Print the ref using the given format and quote_style */
-void show_ref_array_item(struct ref_array_item *info, const char *format, int quote_style);
+void show_ref_array_item(struct ref_array_item *info, const char *format, int quote_style, unsigned int lines);
I would add "If lines > 0, prints the first 'lines' no of lines of the
object pointed to" or so to the docstring.
Will do, thanks.

-- 
Regards,
Karthik Nayak
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help