Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3120 by yaneg...@gmail.com: git diff not automatically detected for pre-commits
http://code.google.com/p/reviewboard/issues/detail?id=3120

What version are you running?

0.5.2-dev

What's the URL of the page containing the problem?

n/a

What steps will reproduce the problem?
1. Hack on a file in a git clone.
2. git diff it to make sure that there's some change in the file.
3. Try running post-review.

What is the expected output? What do you see instead?

It should go through posting the file (similar to what I'm used to with the SVN integration with the tool). Unfortunately it doesn't work because the revisions specified are wrong (please note that explicitly stating "HEAD" works):

garrett.cooper@ZL00757 ~/git/rbtools
$ git diff .
diff --git a/rbtools/clients/git.py b/rbtools/clients/git.py
index 4d7ace1..790d105 100644
--- a/rbtools/clients/git.py
+++ b/rbtools/clients/git.py
@@ -309,12 +309,15 @@ class GitClient(SCMClient):
             return self.make_perforce_diff(ancestor, diff_lines)
         elif self.type == "git":
             cmdline = [self.git, "diff", "--no-color", "--full-index",
-                       "--no-ext-diff", "--ignore-submodules", "--no-renames",
-                       rev_range]
+                       "--no-ext-diff", "--ignore-submodules"]

             if (self.capabilities is not None and
                 self.capabilities.has_capability('diffs', 'moved_files')):
-                cmdline.append('-M')
+                cmdline.append('--find-renames')
+            else:
+                cmdline.append('--no-renames')
+
+            cmdline += [rev_range]

             return execute(cmdline)
garrett.cooper@ZL00757 ~/git/rbtools
$ post-review
git diff --no-color --full-index --no-ext-diff --ignore-submodules --find-renames 9b502ee44382d53e956ae68bb6215cd2cc723ac0..refs/heads/master
There don't seem to be any diffs!

$ post-review --revision-range=HEAD
git diff --no-color --full-index --no-ext-diff --ignore-submodules --find-renames HEAD
Review request #4821 posted.

garrett.cooper@ZL00757 ~/git/rbtools
$ rbt post --revision-range=HEAD
git diff --no-color --full-index --no-ext-diff --ignore-submodules --find-renames HEAD
Review request #4822 posted.

http://reviews.reviewboard.org/r/4822/

garrett.cooper@ZL00757 ~/git/rbtools
$ rbt post
git diff --no-color --full-index --no-ext-diff --ignore-submodules --find-renames 9b502ee44382d53e956ae68bb6215cd2cc723ac0..refs/heads/master
ERROR:root:There don't seem to be any diffs!

What operating system are you using? What browser?

Cygwin.

Please provide any additional information below.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to