Thread (20 messages) 20 messages, 5 authors, 2025-03-19

Re: [PATCH 2/2] reflog: implement subcommand to drop reflogs

From: Karthik Nayak <hidden>
Date: 2025-03-07 13:28:01

Patrick Steinhardt [off-list ref] writes:
On Fri, Mar 07, 2025 at 06:53:31AM -0600, Karthik Nayak wrote:
quoted
Patrick Steinhardt [off-list ref] writes:
quoted
On Fri, Mar 07, 2025 at 12:17:26PM +0100, Karthik Nayak wrote:
quoted
@@ -447,10 +456,56 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix,
 				   refname);
 }

+static int cmd_reflog_drop(int argc, const char **argv, const char *prefix,
+			   struct repository *repo)
+{
+	int i, ret, do_all;
+	const struct option options[] = {
+		OPT_BOOL(0, "all", &do_all, N_("process the reflogs of all references")),
+		OPT_END()
+	};
+
+	do_all = ret = 0;
Can't we initiailize the variables directly when declaring them?
We can, let me fix it! I'll also move the initialization of 'i' down to
the loop while we're here.
You can also avoid declaring `i` here at all and just declare it inside
the loop.

Patrick

Attachments

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