All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] log: fix memory leak if --graph is passed multiple times
@ 2022-02-09 16:23 Alex Henrie
  2022-02-09 16:23 ` [PATCH 2/3] log: add a config option for --graph Alex Henrie
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alex Henrie @ 2022-02-09 16:23 UTC (permalink / raw)
  To: git, paulus; +Cc: Alex Henrie

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 revision.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/revision.c b/revision.c
index ad4286fbdd..c03c387edd 100644
--- a/revision.c
+++ b/revision.c
@@ -2424,9 +2424,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		revs->pretty_given = 1;
 		revs->abbrev_commit = 1;
 	} else if (!strcmp(arg, "--graph")) {
-		revs->topo_order = 1;
-		revs->rewrite_parents = 1;
-		revs->graph = graph_init(revs);
+		if (!revs->graph) {
+			revs->topo_order = 1;
+			revs->rewrite_parents = 1;
+			revs->graph = graph_init(revs);
+		}
 	} else if (!strcmp(arg, "--encode-email-headers")) {
 		revs->encode_email_headers = 1;
 	} else if (!strcmp(arg, "--no-encode-email-headers")) {
-- 
2.32.0.2645.gc109162a1f


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-10 20:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 16:23 [PATCH 1/3] log: fix memory leak if --graph is passed multiple times Alex Henrie
2022-02-09 16:23 ` [PATCH 2/3] log: add a config option for --graph Alex Henrie
2022-02-09 18:25   ` Junio C Hamano
2022-02-10 16:49     ` Alex Henrie
2022-02-09 16:23 ` [PATCH 3/3] gitk: set log.graph=false when running `git log` Alex Henrie
2022-02-09 18:26   ` Junio C Hamano
2022-02-10 16:50     ` Alex Henrie
2022-02-10 20:15       ` Junio C Hamano
2022-02-09 18:16 ` [PATCH 1/3] log: fix memory leak if --graph is passed multiple times Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.