Details

    Description

      Based on documentation:

      Usage:
                  $0 \[options\] \[git diff arguments\]
      

      The dgcov program runs gcov for code coverage analysis, and reports missing
      coverage only for those lines that are changed by the specified commit(s).
      Commits are specified in the format of git diff arguments. For example:
       * All unpushed commits:        $0 \@{u} HEAD
       * All uncommitted changes:     $0 HEAD
       * Specific commit:             $0 <commit>^ <commit>
       
      If no arguments are specified, it prints the coverage for all uncommitted
      changes, if any, otherwise for the last commit.
      

      Meaning if no changes and args in usage of dgcov than changes from last commit should be presented.
      If we debug: dgcov --generate>file and no git diff in our tree, we see that command that is invoked for printing:
      git diff --no-prefix --ignore-space-change HEAD and it results in empty result in a file.
      It should show changes from the last commit.

      serg can you please confirm above?

      Attachments

        Issue Links

          Activity

            Nope. Works fine for me. Check the code. It has

            if (@ARGV) {
              print_gcov_for_diff(@ARGV);
            } else {
              print_gcov_for_diff('HEAD') or print_gcov_for_diff('HEAD^');
            }
            

            obvisouly, it means either a diff for HEAD and if it's empty, a diff for HEAD^. Meaning, print_gcov_for_diff() should return whether a diff is empty. It does

              while (<PIPE>) {
                if (/^diff --git (.*) \1\n/) {
                  print $acc if $printme;
                  $fname=$1;
                  ...
              return defined($fname);
            }
            

            so it returns true if there was at least one diff --git line.

            Now run

            git diff --no-prefix --ignore-space-change HEAD
            

            manually and see what it returns for you. When it's empty, dgcov.pl correctly tries HEAD^ for me, as expected.

            serg Sergei Golubchik added a comment - Nope. Works fine for me. Check the code. It has if ( @ARGV ) { print_gcov_for_diff( @ARGV ); } else { print_gcov_for_diff( 'HEAD' ) or print_gcov_for_diff( 'HEAD^' ); } obvisouly, it means either a diff for HEAD and if it's empty, a diff for HEAD^ . Meaning, print_gcov_for_diff() should return whether a diff is empty. It does while (< PIPE >) { if (/^diff --git (.*) \1\n/) { print $acc if $printme ; $fname = $1 ; ... return defined ( $fname ); } so it returns true if there was at least one diff --git line. Now run git diff --no-prefix --ignore-space-change HEAD manually and see what it returns for you. When it's empty, dgcov.pl correctly tries HEAD^ for me, as expected.

            Ahh I was confused with last commit in help. Expected to see git show somewhere missed git diff HEAD^ what is the actually git show without commit message.
            Thanks Serg.

            anel Anel Husakovic added a comment - Ahh I was confused with last commit in help. Expected to see git show somewhere missed git diff HEAD^ what is the actually git show without commit message. Thanks Serg.

            People

              anel Anel Husakovic
              anel Anel Husakovic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.