git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH V5 16/17] Add tests for line history browser

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 12, 2010, 01:25 UTC
Message-ID
<AANLkTi=qvywaiwYpr7ZZ6Gf0i_curaLr0E8gRLD5WTK-@mail.gmail.com>
In-Reply-To
<1281539022-31616-17-git-send-email-struggleyb.nku@gmail.com>
On Wed, Aug 11, 2010 at 15:03, Bo Yang <struggleyb.nku@gmail.com> wrote:
Show 5 quoted lines
> t/t4301-log-line-single-history.sh:
>  test the linear line of history.
>
> t/t4302-log-line-merge-history.sh:
>  test the case that there are merges in the history.

This is failing smoke tests on my smoker: http://smoke.git.nix.is/app/projects/report_details/21

> Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
> +test_expect_success 'validate the path0 output.' '
> +    test_cmp current-path0 expected-path0
> +'
That gives me:
    $ diff -ru trash\
directory.t4301-log-line-single-history/{expected,current}-path0
    --- trash directory.t4301-log-line-single-history/expected-path0
     2010-08-12 01:20:18.000000000 +0000
    +++ trash directory.t4301-log-line-single-history/current-path0
2010-08-12 01:20:18.000000000 +0000
    @@ -6,8 +6,8 @@
     +++ b/path0
     @@ -1,6 +1,5 @@
      void func(){
    -       int a = 10;
    -       int b = 11;
    +       int a = 10;
    +       int b = 11;
     -      int c;
     -      c = 10 * (a + b);
     +      printf("%d", a - b);
    @@ -21,9 +21,9 @@
     +++ b/path0
     @@ -1,6 +1,6 @@
      void func(){
    -       int a = 10;
    -       int b = 11;
    -       int c;
    +       int a = 10;
    +       int b = 11;
    +       int c;
     -      c = a + b;
     +      c = 10 * (a + b);
      }
    @@ -40,8 +40,8 @@
     -      int b = 1;
     +      int a = 10;
     +      int b = 11;
    -       int c;
    -       c = a + b;
    +       int c;
    +       c = a + b;
      }
     Base commit
> [...]
More of these test fails, see the TAP output at the smoker.
> diff --git a/t/t4302-log-line-merge-history.sh b/t/t4302-log-line-merge-history.sh
> new file mode 100755
> index 0000000..1536cc4
> --- /dev/null
[...]
> +test_expect_success \
> +    'validate the output.' \
> +    'test_cmp current expected'
Gives:
    $ diff -ru trash\ directory.t4302-log-line-merge-history/{expected,current}
    --- trash directory.t4302-log-line-merge-history/expected
2010-08-12 01:21:47.000000000 +0000
    +++ trash directory.t4302-log-line-merge-history/current
2010-08-12 01:21:47.000000000 +0000
    @@ -3,7 +3,7 @@
     nontrivial merge found
     path0
     @@ 2,1 @@
    -       printf("hello earth and moon");
    +       printf("hello earth and moon");
     Change path0 in master
That's just a whitespace change, the diff goes away on diff -w.
> +test_expect_success \
> +    'validate the graph output.' \
> +    'test_cmp current-graph expected-graph'
> +
More whitespace changes:
    $ diff -ru trash\
directory.t4302-log-line-merge-history/{expected,current}-graph
    --- trash directory.t4302-log-line-merge-history/expected-graph
2010-08-12 01:23:53.000000000 +0000
    +++ trash directory.t4302-log-line-merge-history/current-graph
2010-08-12 01:23:53.000000000 +0000
    @@ -1,14 +1,14 @@
     *   Merge two branches
    -|\
    -| |
    +|\
    +| |
     | | nontrivial merge found
     | | path0
     | | @@ 2,1 @@
     | |    printf("hello earth and moon");
    -| |
    -| |
    +| |
    +| |
     | * Change path0 in master
    -| |
    +| |
     | | diff --git a/path0 b/path0
     | | index f628dea..bef7fa3 100644
     | | --- a/path0
    @@ -16,10 +16,10 @@
     | | @@ -2,1 +2,1 @@
     | | -  printf("hello");
     | | +  printf("hello earth");
    -| |
    +| |
     * | Change path0 in feature
    -|/
    -|
    +|/
    +|
     |   diff --git a/path0 b/path0
     |   index f628dea..a940ef6 100644
     |   --- a/path0
    @@ -27,9 +27,9 @@
     |   @@ -2,1 +2,1 @@
     |   -  printf("hello");
     |   +  print("hello moon");
    -|
    +|
     * Base commit
    -
    +
       diff --git a/path0 b/path0
       new file mode 100644
       index 0000000..f628dea
Previous: Bo YangNext: Bo Yang
Message 21 of 28 in “Reroll a version 5 of this series”
  1. 00/17 Reroll a version 5 of this seriesBo Yang, Aug 11, 2010
  2. 01/17 parse-options: enhance STOP_AT_NON_OPTIONBo Yang, Aug 11, 2010
  3. 02/17 parse-options: add two helper functionsBo Yang, Aug 11, 2010
  4. 03/17 Add the basic data structure for line level historyBo Yang, Aug 11, 2010
  5. 04/17 Refactor parse_locBo Yang, Aug 11, 2010
  6. 05/17 Parse the -L optionsBo Yang, Aug 11, 2010
  7. 06/17 Export three functions from diff.cBo Yang, Aug 11, 2010
  8. 07/17 Add range clone functionsBo Yang, Aug 11, 2010
  9. 08/17 map/take range to the parent of commitsBo Yang, Aug 11, 2010
  10. 09/17 Print the line logBo Yang, Aug 11, 2010
  11. 10/17 Hook line history into cmd_log, ensuring a topo-ordered walkBo Yang, Aug 11, 2010
  12. 11/17 Make rewrite_parents public to other part of gitBo Yang, Aug 11, 2010
  13. 12/17 Make graph_next_line external to other part of gitBo Yang, Aug 11, 2010
  14. 13/17 Add parent rewriting to line history browserBo Yang, Aug 11, 2010
  15. log -L crash (Re: [PATCH V5 13/17] Add parent rewriting to line history browser)Jonathan Nieder, Aug 30, 2010
  16. Bo YangSep 1, 2010
  17. log -L: do not free parents lists we might need againThomas Rast, Sep 11, 2010
  18. 14/17 Add --graph prefix before line history outputBo Yang, Aug 11, 2010
  19. 15/17 Add --full-line-diff optionBo Yang, Aug 11, 2010
  20. 16/17 Add tests for line history browserBo Yang, Aug 11, 2010
  21. Ævar Arnfjörð BjarmasonAug 12, 2010
  22. Bo YangAug 12, 2010
  23. Ævar Arnfjörð BjarmasonAug 12, 2010
  24. Junio C HamanoAug 12, 2010
  25. Junio C HamanoAug 12, 2010
  26. 17/17 Document line history browserBo Yang, Aug 11, 2010
  27. david@lang.hmAug 12, 2010
  28. Junio C HamanoAug 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.