log --follow

John Keeping john at keeping.me.uk
Mon Apr 15 14:38:45 CEST 2013


On Mon, Apr 15, 2013 at 01:51:43PM +0200, René Neumann wrote:
> I just noticed that cgit does not show history over renames. Is it
> somehow reasonable to add "--follow" by default, or make it an option?
> Or are there reasons against it?

I don't think it should be turned on unconditionally, since it does
require some more work to generate the log, but I see no reason why we
couldn't add an option for it.

The patch below should cause the log to be generated with "--follow",
but obviously it needs more work to be turned into a proper patch.  If
this is useful I'll try to find some time to do this properly.

-- >8 --
diff --git a/ui-log.c b/ui-log.c
index 2aa12c3..01bddd1 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -342,7 +342,9 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
 	}
 
 	if (path) {
+		static const char *follow_arg = "--follow";
 		static const char *double_dash_arg = "--";
+		vector_push(&vec, &follow_arg, 0);
 		vector_push(&vec, &double_dash_arg, 0);
 		vector_push(&vec, &path, 0);
 	}




More information about the CGit mailing list