Code

Clean up incomplete commits from main view listed for --no-walk
authorJonas Fonseca <fonseca@diku.dk>
Tue, 5 Aug 2008 21:40:21 +0000 (23:40 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 5 Aug 2008 21:45:28 +0000 (23:45 +0200)
When --no-walk is given on the command line by the user it causes
boundary commits to be output with just the commit line, i.e:

  > git rev-list --pretty=raw --boundary --no-walk HEAD
  commit 60e8ea56880fc2e42008075d516c356ef605bc60
  tree 5b76086e4deaf62d3f7baffc6f49840f61d4e79c
  parent 145194bdfc8bf0b58185bbe28bc0097ce429de4d
  author Jonas Fonseca <fonseca@diku.dk> 1217797175 +0200
  committer Jonas Fonseca <fonseca@diku.dk> 1217797402 +0200

      Remove the global opt_request variable

  commit -145194bdfc8bf0b58185bbe28bc0097ce429de4d

NEWS
tig.c

diff --git a/NEWS b/NEWS
index b7a8df17ea3b650d0d46066ddb441c20a48c3bb8..d93fb04bc7cb317e03ad2a8b7febe567ba850a96 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ Bug fixes:
    keybinding to launch the merge tool in the status view.
  - Fix problem with $(cmd) usage in shell code. Some shells (jsh)
    installed as /bin/sh does not support it.
+ - Do not show incomplete boundary commits when --no-walk is used.
  - Documentation: Rename gitlink macro to support AsciiDoc 8.2.3.
 
 tig-0.11
diff --git a/tig.c b/tig.c
index 68465192d31d87bab36ca44ed434abeccaf74a86..6b111e43a3fede913e60ca16493eb39dfc60e338 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -4983,6 +4983,14 @@ main_read(struct view *view, char *line)
        if (!line) {
                if (!view->lines && !view->parent)
                        die("No revisions match the given arguments.");
+               if (view->lines > 0) {
+                       commit = view->line[view->lines - 1].data;
+                       if (!*commit->author) {
+                               view->lines--;
+                               free(commit);
+                               graph->commit = NULL;
+                       }
+               }
                update_rev_graph(graph);
                return TRUE;
        }