Forum Discussion

pratik222's avatar
pratik222
New Contributor
9 years ago

addgitdiffs per file

Hello,

   When i run this command using git, it works just fine.

 

git diff sha1...sha2 relative/path/to/file

 

 

   But when i try to use this same idea with addgitdiffs it doesn't like the file.

 

ccollab addgitdiffs new sha1...sha2 relative/path/to/file

 

Checking that you are allowed to upload files to this review.
ERROR: SCM system communication problem:
Unexpected output on stderr starting with:
fatal: bad revision 'relative/path/to/file'

 

Can you please tell me if this is supported? 

also if it is not supported to upload git diff per file, then what is the best way to generate file based reviews.  (under git repo)

 

-Pratik.

2 Replies

  • You need a "--" between the revision identifiers and the path(s), e.g. ccollab addgitdiffs new sha1 sha2 -- relative/path/to/file

     

    (This requirement is from git diff itself, we only pass those options through to the git client to interpret.)

    • gorth5's avatar
      gorth5
      New Contributor

      git diff does not require a '--' between the revisions and path, at least not the way I'm using it.   For example, I can run this command just fine, and it happily displays my diffs.

       

      git diff 3b42 f249 path/to/specific/files

       

      However, running ccollab addgitdiffs new 3b42 f249 path/to/specific/files tries to interpret the path as a revision, and fails.  If I follow your suggestion and add the "--" ...

       

      ccollab addgitdiffs new 3b42 f249 -- path/to/specific/files

       

      I get a different error ...

       

      ERROR: Executing command `ccollab addgitdiffs`:
      There are no diffs to upload

       

      My working directory is clean, but I'm trying to create a review for a diff between two already committed revisions.  It's almost as if code collab is ignoring all the arguments before the path.  However, it only seems to do so if a path is specified.  If I just run this ...

       

      ccollab addgitdiffs new 3b42 f249

       

      It works just fine.  So code collab is definitely mangling something before passing it along to git diff.  Here are my versions of things ...

       

      ccollab --version
      ccollab v9.2.9200

       

      git --version
      git version 1.9.5 (Apple Git-50.3)

       

      (Note: Also posted this comment on http://community.smartbear.com/t5/Collaborator/Add-Git-Diffs-with-path/m-p/115786 ... seems to be exactly the same issue)