Re: Unable to use git diff with post-review or diff upload.

2017-04-13 Thread Phyo Aung Si
This issue is very serious when reviewboard use Mask URL.

Mask url have to pass  revision id for git server. But git diff is 
generating hash number of the file. So when mask URL pass the hash value to 
git server instead of revision id , every thing gone wrong and ReviewBoard 
have to be nothing.



On Monday, June 10, 2013 at 4:14:59 PM UTC+8, Christian Hammond wrote:
>
> Hi,
>
> post-review and rbt post will, by default, generate a diff from 
> master..HEAD. If your commits on master aren't pushed, you will have 
> problems.
>
> Is your nearest remote branch origin/master? If so, can you be certain 
> that origin/master matches what's shown on your gitweb?
>
> You also generally don't want to do --parent=master. That's really 
> intended for when you have some unpushed feature branch you're basing your 
> change off of.
>
> Christian
>
> -- 
> Christian Hammond - chi...@chipx86.com 
> Review Board - http://www.reviewboard.org
> Beanbag, Inc. - http://www.beanbaginc.com
>
>
> On Sat, Jun 8, 2013 at 2:12 PM, Safder Ali Khan  > wrote:
>
>> We are using reviewboard successfully with SVN repos and wanted to use it 
>> for one of our git repos. I have done the setup as instructed in the 
>> documentation but I get error when uploading the diff or using post-review 
>> about revision not found. All git functionality for server communication 
>> like pull/push work fine. Need some help to get this going. Seems I am 
>> missing some basic setup. Both git centralized server and client are Linux.
>>
>> ReviewBoard : 1.7.9 - installed yesterday.
>> git version 1.7.12.4 (On client) - SLES11SP2
>> git version 1.7.11.3 (On server) - RHEL6
>>
>> In Repository setup:
>> Path : http://10.5.116.164/git/test.git
>> Raw File URL (Gitweb URL): 
>> http://10.5.116.164/git/?p=test.git;a=blob_plain;f=
>> ;hb=
>>
>>
>> Error with post-review:
>>
>> test> git remote -v
>> origin  http://10.5.116.164/git/test.git (fetch)
>> origin  http://10.5.116.164/git/test.git (push)
>>
>>
>> test> git status
>> # On branch master
>> # Changes not staged for commit:
>> #   (use "git add ..." to update what will be committed)
>> #   (use "git checkout -- ..." to discard changes in working 
>> directory)
>> #
>> #   modified:   README
>> #   modified:   TODO
>> #
>> # Untracked files:
>> #   (use "git add ..." to include in what will be committed)
>> #
>> #   test.diff
>> no changes added to commit (use "git add" and/or "git commit -a")
>>
>>
>>
>> test> post-review --parent=master -d
>> >>> RBTools 0.5.1
>> >>> Python 2.6.8 (unknown, May 29 2012, 22:30:44)
>> [GCC 4.3.4 [gcc-4_3-branch revision 152973]]
>> >>> Running on Linux-3.0.42-0.7-default-x86_64-with-SuSE-11-x86_64
>> >>> Home = /xxx/xx
>> >>> Current Directory = /x/x/x//test
>> >>> Checking the repository type. Errors shown below are mostly harmless.
>> DEBUG:root:Checking for a Subversion repository...
>> DEBUG:root:Running: svn info --non-interactive
>> DEBUG:root:Command exited with rc 1: ['svn', 'info', '--non-interactive']
>> svn: E155007: '/khans16/atmos/workspaces/bds/test' is not a working copy
>> ---
>> DEBUG:root:Checking for a Git repository...
>> DEBUG:root:Running: git rev-parse --git-dir
>> DEBUG:root:Running: git config core.bare
>> DEBUG:root:Running: git rev-parse --show-toplevel
>> DEBUG:root:Running: git symbolic-ref -q HEAD
>> DEBUG:root:Running: git config --get branch.master.merge
>> DEBUG:root:Running: git config --get branch.master.remote
>> DEBUG:root:Running: git config --get remote.origin.url
>> DEBUG:root:repository info: Path: http://10.5.116.164/git/test.git, Base 
>> path: , Supports changesets: False
>> >>> Finished checking the repository type.
>> DEBUG:root:Running: git config --get reviewboard.url
>> >>> HTTP GETting api/info/
>> DEBUG:root:Running: git merge-base origin/master refs/heads/master
>> DEBUG:root:Running: git diff --no-color --full-index --no-ext-diff 
>> --ignore-submodules --no-renames master -M
>> DEBUG:root:Running: git diff --no-color --full-index --no-ext-diff 
>> --ignore-submodules --no-renames 
>> 241130aabad99b2f01d6dc6e82a31b12f9008268..master -M
>> >>> HTTP GETting api/
>> >>> HTTP GETting http://ias009xf4w01.isus.emc.com/rb/api/info/
>> >>> Using the new web API
>> >>> Attempting to create review request on 
>> http://10.5.116.164/git/test.git for None
>> >>> HTTP POSTing to 
>> http://ias009xf4w01.isus.emc.com/rb/api/review-requests/: {'repository': 
>> 'http://10.5.116.164/git/test.git'}
>> >>> Review request created
>> >>> Uploading diff, size: 536
>> >>> HTTP POSTing to 
>> http://ias009xf4w01.isus.emc.com/rb/api/review-requests/17/diffs/: {}
>> >>> Got API Error 207 (HTTP code 400): The file was not found in the 
>> repository
>> >>> Error data: {u'stat': u'fail', u'file': u'README', u'err': {u'msg': 
>> u'The file was not found in the repository', u'code': 207}, u'revision': 
>> u'2461f9cf2dc3f14842bd5b8593388a90f96a7ae3'}
>>
>> Error uploading diff
>>
>> Your 

Re: Unable to use git diff with post-review or diff upload.

2013-06-10 Thread Safder Ali Khan
Hi Christian,

I am working on the master branch and push to origin/master. All commits 
from master have been pushed to origin/master and it all look in sync. I 
can also see the README file's last push in gitweb. I am including some 
command output. What command is actually run when uploading diff. I can try 
to run it manually on the server. But from the output below it all looks to 
be in order.

git ls-remote http://10.5.116.164/git/test.git HEAD
241130aabad99b2f01d6dc6e82a31b12f9008268HEAD

 git push
Everything up-to-date

git log -1 README
commit 241130aabad99b2f01d6dc6e82a31b12f9008268
Author: Safder Khan xx
Date:   Fri May 31 16:12:55 2013 +

Test email format

 git diff --full-index README
diff --git a/README b/README
index 
2461f9cf2dc3f14842bd5b8593388a90f96a7ae3..66997e8336f1340476ce8717d45a1f932212b0de
 
100644
--- a/README
+++ b/README
@@ -33,3 +33,4 @@ again
 last one
 email works fine
 Check format of email if user and name not set
+reviewboard integration


I can see the latest commit on gitweb as well and also blob_plain for the 
file. I am listing the URLs from gitweb below.

http://10.5.116.164/git/?p=test.git;a=commit;h=241130aabad99b2f01d6dc6e82a31b12f9008268

Test email format 
http://10.5.116.164/git?p=test.git;a=commitdiff;h=241130aabad99b2f01d6dc6e82a31b12f9008268
master http://10.5.116.164/git?p=test.git;a=shortlog;h=refs/heads/master
authorSafder 
Khanhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=Safder+Khan;st=author
 
xhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=khan...@khans16-linux1.lss.emc.com;st=authorFri,
 
31 May 2013 12:12:55 -0400 (16:12 +)committerSafder 
Khanhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=Safder+Khan;st=committer
 
xhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=khan...@khans16-linux1.lss.emc.com;st=committerFri,
 
31 May 2013 12:12:55 -0400 (16:12 +)commit
241130aabad99b2f01d6dc6e82a31b12f9008268tree
5b3ac9dd2e937d21206d74041525be8708764c1fhttp://10.5.116.164/git?p=test.git;a=tree;h=5b3ac9dd2e937d21206d74041525be8708764c1f;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
treehttp://10.5.116.164/git?p=test.git;a=tree;h=5b3ac9dd2e937d21206d74041525be8708764c1f;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
 | 
snapshothttp://10.5.116.164/git?p=test.git;a=snapshot;h=241130aabad99b2f01d6dc6e82a31b12f9008268;sf=tgz
parenta74d3946315de033fffcd91ce0f5599eecd6170chttp://10.5.116.164/git?p=test.git;a=commit;h=a74d3946315de033fffcd91ce0f5599eecd6170c
commithttp://10.5.116.164/git?p=test.git;a=commit;h=a74d3946315de033fffcd91ce0f5599eecd6170c
 | 
diffhttp://10.5.116.164/git?p=test.git;a=commitdiff;h=241130aabad99b2f01d6dc6e82a31b12f9008268;hp=a74d3946315de033fffcd91ce0f5599eecd6170c
Test email format

Gitweb link for blob_plain of file.
http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;h=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
If I pass 
http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;hb=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3
which Reviewboard seems to be passing  I get a 404 Cannot find file Error 
But 
http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;h=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3
works and gives me the file blob_plain.
So I changed the gitweb URL is review board to 
http://10.5.116.164/git/?p=test.git;a=blob_plain;f=filename;h=revision
and restarted memcache but still get revision not found when I try to 
upload the diff. I read some other online discussions on this it seems some 
folks have resolved the issue by using h instead of hb but it does not work 
for me in reviewboard even though gitweb does display blob_plain.
The file 'README' (r2461f9cf2dc3f14842bd5b8593388a90f96a7ae3) could not be 
found in the repository
I suspect the error is displayed by some check before it even looks at the 
gitweb URL. Can you please let me know what reviewboard is running to 
verify the version so I can run it on the review board server to verify.

-Safder

On Monday, June 10, 2013 4:14:59 AM UTC-4, Christian Hammond wrote:

 Hi,

 post-review and rbt post will, by default, generate a diff from 
 master..HEAD. If your commits on master aren't pushed, you will have 
 problems.

 Is your nearest remote branch origin/master? If so, can you be certain 
 that origin/master matches what's shown on your gitweb?

 You also generally don't want to do --parent=master. That's really 
 intended for when you have some unpushed feature branch you're basing your 
 change off of.

 Christian

 -- 
 Christian Hammond - chi...@chipx86.com javascript:
 Review Board - http://www.reviewboard.org
 Beanbag, Inc. - http://www.beanbaginc.com


 On Sat, Jun 8, 2013 at 2:12 PM, Safder Ali Khan 
 safde...@gmail.comjavascript:
  wrote:

 We are using reviewboard successfully with SVN repos and 

Re: Unable to use git diff with post-review or diff upload.

2013-06-10 Thread Safder Ali Khan
One more observation. It seems that the version that needs to be passed is 
the commit index version and not the file index. If I navigate from gitweb 
via tree - README - history - blob for the latest version it is 
displayed in this URL.

http://10.5.116.164/git/?p=test.git;a=blob;f=README;hb=241130aabad99b2f01d6dc6e82a31b12f9008268

As you can see the hb=commit index version

-Safder

On Monday, June 10, 2013 2:34:15 PM UTC-4, Safder Ali Khan wrote:

 Hi Christian,

 I am working on the master branch and push to origin/master. All commits 
 from master have been pushed to origin/master and it all look in sync. I 
 can also see the README file's last push in gitweb. I am including some 
 command output. What command is actually run when uploading diff. I can try 
 to run it manually on the server. But from the output below it all looks to 
 be in order.

 git ls-remote http://10.5.116.164/git/test.git HEAD
 241130aabad99b2f01d6dc6e82a31b12f9008268HEAD

  git push
 Everything up-to-date

 git log -1 README
 commit 241130aabad99b2f01d6dc6e82a31b12f9008268
 Author: Safder Khan xx
 Date:   Fri May 31 16:12:55 2013 +

 Test email format

  git diff --full-index README
 diff --git a/README b/README
 index 
 2461f9cf2dc3f14842bd5b8593388a90f96a7ae3..66997e8336f1340476ce8717d45a1f932212b0de
  
 100644
 --- a/README
 +++ b/README
 @@ -33,3 +33,4 @@ again
  last one
  email works fine
  Check format of email if user and name not set
 +reviewboard integration


 I can see the latest commit on gitweb as well and also blob_plain for the 
 file. I am listing the URLs from gitweb below.


 http://10.5.116.164/git/?p=test.git;a=commit;h=241130aabad99b2f01d6dc6e82a31b12f9008268

 Test email format 
 http://10.5.116.164/git?p=test.git;a=commitdiff;h=241130aabad99b2f01d6dc6e82a31b12f9008268
 master http://10.5.116.164/git?p=test.git;a=shortlog;h=refs/heads/master
 authorSafder 
 Khanhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=Safder+Khan;st=author
  
 xhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=khan...@khans16-linux1.lss.emc.com;st=authorFri,
  
 31 May 2013 12:12:55 -0400 (16:12 +)committerSafder 
 Khanhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=Safder+Khan;st=committer
  
 xhttp://10.5.116.164/git?p=test.git;a=search;h=241130aabad99b2f01d6dc6e82a31b12f9008268;s=khan...@khans16-linux1.lss.emc.com;st=committerFri,
  
 31 May 2013 12:12:55 -0400 (16:12 +)commit
 241130aabad99b2f01d6dc6e82a31b12f9008268tree
 5b3ac9dd2e937d21206d74041525be8708764c1fhttp://10.5.116.164/git?p=test.git;a=tree;h=5b3ac9dd2e937d21206d74041525be8708764c1f;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
 treehttp://10.5.116.164/git?p=test.git;a=tree;h=5b3ac9dd2e937d21206d74041525be8708764c1f;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
  | 
 snapshothttp://10.5.116.164/git?p=test.git;a=snapshot;h=241130aabad99b2f01d6dc6e82a31b12f9008268;sf=tgz
 parenta74d3946315de033fffcd91ce0f5599eecd6170chttp://10.5.116.164/git?p=test.git;a=commit;h=a74d3946315de033fffcd91ce0f5599eecd6170c
 commithttp://10.5.116.164/git?p=test.git;a=commit;h=a74d3946315de033fffcd91ce0f5599eecd6170c
  | 
 diffhttp://10.5.116.164/git?p=test.git;a=commitdiff;h=241130aabad99b2f01d6dc6e82a31b12f9008268;hp=a74d3946315de033fffcd91ce0f5599eecd6170c
 Test email format

 Gitweb link for blob_plain of file.

 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;h=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
 If I pass 

 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;hb=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3
 which Reviewboard seems to be passing  I get a 404 Cannot find file 
 Error 
 But 

 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;h=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3
 works and gives me the file blob_plain.
 So I changed the gitweb URL is review board to 
 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=filename;h=revision
 and restarted memcache but still get revision not found when I try to 
 upload the diff. I read some other online discussions on this it seems some 
 folks have resolved the issue by using h instead of hb but it does not work 
 for me in reviewboard even though gitweb does display blob_plain.
 The file 'README' (r2461f9cf2dc3f14842bd5b8593388a90f96a7ae3) could not 
 be found in the repository
 I suspect the error is displayed by some check before it even looks at the 
 gitweb URL. Can you please let me know what reviewboard is running to 
 verify the version so I can run it on the review board server to verify.

 -Safder

 On Monday, June 10, 2013 4:14:59 AM UTC-4, Christian Hammond wrote:

 Hi,

 post-review and rbt post will, by default, generate a diff from 
 master..HEAD. If your commits on master aren't pushed, you will have 
 problems.

 Is your nearest remote branch origin/master? If so, can 

Re: Unable to use git diff with post-review or diff upload.

2013-06-10 Thread Christian Hammond
We only have the blob SHA1 available, since that's what the diff gives us. You 
will need to use a URL that takes that. A commit SHA1 will not work.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

On Jun 10, 2013, at 12:17 PM, Safder Ali Khan safdera...@gmail.com wrote:

 One more observation. It seems that the version that needs to be passed is 
 the commit index version and not the file index. If I navigate from gitweb 
 via tree - README - history - blob for the latest version it is displayed 
 in this URL.
 
 http://10.5.116.164/git/?p=test.git;a=blob;f=README;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
 
 As you can see the hb=commit index version
 
 -Safder
 
 On Monday, June 10, 2013 2:34:15 PM UTC-4, Safder Ali Khan wrote:
 Hi Christian,
 
 I am working on the master branch and push to origin/master. All commits from 
 master have been pushed to origin/master and it all look in sync. I can also 
 see the README file's last push in gitweb. I am including some command 
 output. What command is actually run when uploading diff. I can try to run it 
 manually on the server. But from the output below it all looks to be in order.
 
 git ls-remote http://10.5.116.164/git/test.git HEAD
 241130aabad99b2f01d6dc6e82a31b12f9008268HEAD
 
  git push
 Everything up-to-date
 
 git log -1 README
 commit 241130aabad99b2f01d6dc6e82a31b12f9008268
 Author: Safder Khan xx
 Date:   Fri May 31 16:12:55 2013 +
 
 Test email format
 
  git diff --full-index README
 diff --git a/README b/README
 index 
 2461f9cf2dc3f14842bd5b8593388a90f96a7ae3..66997e8336f1340476ce8717d45a1f932212b0de
  100644
 --- a/README
 +++ b/README
 @@ -33,3 +33,4 @@ again
  last one
  email works fine
  Check format of email if user and name not set
 +reviewboard integration
 
 
 I can see the latest commit on gitweb as well and also blob_plain for the 
 file. I am listing the URLs from gitweb below.
 
 http://10.5.116.164/git/?p=test.git;a=commit;h=241130aabad99b2f01d6dc6e82a31b12f9008268
 
 Test email format 
 master
 authorSafder Khan x 
 Fri, 31 May 2013 12:12:55 -0400 (16:12 +)
 committer Safder Khan x 
 Fri, 31 May 2013 12:12:55 -0400 (16:12 +)
 commit241130aabad99b2f01d6dc6e82a31b12f9008268
 tree  5b3ac9dd2e937d21206d74041525be8708764c1ftree | snapshot
 parenta74d3946315de033fffcd91ce0f5599eecd6170ccommit | diff
 Test email format
 
 Gitweb link for blob_plain of file.
 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;h=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3;hb=241130aabad99b2f01d6dc6e82a31b12f9008268
 If I pass 
 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;hb=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3
 which Reviewboard seems to be passing  I get a 404 Cannot find file Error 
 But 
 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=README;h=2461f9cf2dc3f14842bd5b8593388a90f96a7ae3
 works and gives me the file blob_plain.
 So I changed the gitweb URL is review board to 
 http://10.5.116.164/git/?p=test.git;a=blob_plain;f=filename;h=revision
 and restarted memcache but still get revision not found when I try to upload 
 the diff. I read some other online discussions on this it seems some folks 
 have resolved the issue by using h instead of hb but it does not work for me 
 in reviewboard even though gitweb does display blob_plain.
 The file 'README' (r2461f9cf2dc3f14842bd5b8593388a90f96a7ae3) could not be 
 found in the repository
 I suspect the error is displayed by some check before it even looks at the 
 gitweb URL. Can you please let me know what reviewboard is running to verify 
 the version so I can run it on the review board server to verify.
 
 -Safder
 
 On Monday, June 10, 2013 4:14:59 AM UTC-4, Christian Hammond wrote:
 Hi,
 
 post-review and rbt post will, by default, generate a diff from master..HEAD. 
 If your commits on master aren't pushed, you will have problems.
 
 Is your nearest remote branch origin/master? If so, can you be certain that 
 origin/master matches what's shown on your gitweb?
 
 You also generally don't want to do --parent=master. That's really intended 
 for when you have some unpushed feature branch you're basing your change off 
 of.
 
 Christian
 
 -- 
 Christian Hammond - chi...@chipx86.com
 Review Board - http://www.reviewboard.org
 Beanbag, Inc. - http://www.beanbaginc.com
 
 
 On Sat, Jun 8, 2013 at 2:12 PM, Safder Ali Khan safde...@gmail.com wrote:
 We are using reviewboard successfully with SVN repos and wanted to use it for 
 one of our git repos. I have done the setup as instructed in the 
 documentation but I get error when uploading the diff or using post-review 
 about revision not found. All git functionality for server communication like 
 pull/push work fine. Need some help to get this going. Seems I am missing 
 some basic setup. Both git centralized server and client 

Re: Unable to use git diff with post-review or diff upload.

2013-06-10 Thread Matthew Woehlke

On 2013-06-10 15:17, Safder Ali Khan wrote:

One more observation. It seems that the version that needs to be passed is
the commit index version and not the file index. If I navigate from gitweb
via tree - README - history - blob for the latest version it is
displayed in this URL.

http://10.5.116.164/git/?p=test.git;a=blob;f=README;hb=241130aabad99b2f01d6dc6e82a31b12f9008268

As you can see the hb=commit index version


As Christian indicated, RB doesn't have a commit SHA. Per 
https://groups.google.com/forum/?fromgroups#!topic/reviewboard/ajn8-zQ7Zn0, 
it may be that you need to use 'h=' rather than 'hb=' with your gitweb 
instance.


--
Matthew

--
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups reviewboard group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.