git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hariom Verma via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Hariom Verma <hariom18599@gmail.com>,
	Hariom Verma <hariom18599@gmail.com>
Subject: [PATCH 3/5] pretty: introduce `get_user_format()`
Date: Mon, 15 Jun 2020 10:57:40 +0000	[thread overview]
Message-ID: <b568d097159ff9d89bc4fc7c9076d9a8a1e29a1e.1592218662.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.658.git.1592218662.gitgitgadget@gmail.com>

From: Hariom Verma <hariom18599@gmail.com>

In the quest of porting pretty formats to use ref-filters logic,
user_format must need to interact with other functions too.
So, to get user_format, introduced `const char *get_user_format()`.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Heba Waly <heba.waly@gmail.com>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
---
 pretty.c | 5 +++++
 pretty.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/pretty.c b/pretty.c
index 2a3d46bf42f..3767c144b0a 100644
--- a/pretty.c
+++ b/pretty.c
@@ -2016,3 +2016,8 @@ void pp_commit_easy(enum cmit_fmt fmt, const struct commit *commit,
 	pp.fmt = fmt;
 	pretty_print_commit(&pp, commit, sb);
 }
+
+const char *get_user_format(void)
+{
+	return user_format;
+}
diff --git a/pretty.h b/pretty.h
index 071f2fb8e44..517450f72f8 100644
--- a/pretty.h
+++ b/pretty.h
@@ -139,4 +139,7 @@ const char *format_subject(struct strbuf *sb, const char *msg,
 /* Check if "cmit_fmt" will produce an empty output. */
 int commit_format_is_empty(enum cmit_fmt);
 
+/* Returns user_format */
+const char *get_user_format(void);
+
 #endif /* PRETTY_H */
-- 
gitgitgadget


  parent reply	other threads:[~2020-06-15 10:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 10:57 [PATCH 0/5] [GSoC][RFC] print commits using ref-filter's logic Hariom Verma via GitGitGadget
2020-06-15 10:57 ` [PATCH 1/5] builtin/log: new config log.useRefFilter Hariom Verma via GitGitGadget
2020-06-15 10:57 ` [PATCH 2/5] revision: add `use_ref_filter` in struct rev_info Hariom Verma via GitGitGadget
2020-06-15 10:57 ` Hariom Verma via GitGitGadget [this message]
2020-06-15 10:57 ` [PATCH 4/5] ref_format: add option to skip `\n` at eol Hariom Verma via GitGitGadget
2020-06-15 10:57 ` [PATCH 5/5] pretty-lib: print commits using ref-filters logic Hariom Verma via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b568d097159ff9d89bc4fc7c9076d9a8a1e29a1e.1592218662.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hariom18599@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).