Issue 1094: gerrit query ssh API missing files changed information
Status:  Incomplete
Owner: ----
Closed:  Jul 2014
Reported by kd...@codeaurora.org, Aug 16, 2011
The 'ssh gerrit query' API should have an option to return all of the files modified in any patch set it shows.

ex:

ssh -p $PORT $SERVER -- "gerrit query --current-patch-set --files change:12345"
should include:

  ...
  currentPatchSet:
    ...
    files:
      path: file1.txt
      type: M
      size: +19, -1

      path: dir/file2.c
      type: A
      size: +46, -0
  ...
Oct 21, 2013
#1 mani.cha...@tcs.com
When you say it should show files modified in any patch set, does it mean modified with respect to the previous patch set or modified with respect to master.

Oct 22, 2013
#2 daniel.i...@gmail.com
Hi,

My impression when mining Gerrit is that each patch "touches" some files (add, remove, copy, move, etc...). 

In this case and from my point of view (not the original author of the feature request) it would be great if the list of "touched" files per patch is provided in somehow.

So, I guess that the patch should be compared with respect to master, but again, I didn't open the feature request :). 


Oct 22, 2013
#3 kd...@codeaurora.org
I was looking for the files modified with respect to the parent of the commit (so master or another change, not the previous patch-set).
Oct 23, 2013
#4 mani.cha...@tcs.com
Thanks. 
Just to clarify the requirement.
I guess in above command change:12345, here 12345 refers to the change id associated with patchsets right?

For eg. Below for 4 patchsets (for the same change) there are 4 different ids.
So to see files for a particluar patchset we need to put the id for respective pacthset in place of change:12345, right? 
 ssh -p $PORT $SERVER -- "gerrit query --current-patch-set --files change:12345"

Dependencies 
Reference Version: Base
 Patch Set 1 
  85290f1a7f262525aaa73bfcaad31d284182196b  
 Patch Set 2 
  d5dbad07ea6a3a770c49eae3d7d7e54040a968d5  
 Patch Set 3 
  ba6a44f09b325ec2ba6b2e45616bb6e059e31820  
 Patch Set 4 
  32174421a6374b59ab36c34e008c7867ef1e59fd


Also, please specify the exact parameters that you would expect to see in output when adding option --files with  gerrit query.
Oct 23, 2013
#5 kd...@codeaurora.org
'change:12345' is the actual query sting provided to gerrit, I would expect similar behavior for any other query. The --files information is related to a patch set, so it should be included in any patch sets returned by the query (similar to how the approvals information works now). That is, if I specify '--current-patch-set --files' I would expect file information for the current patch set of any change that was returned by the query. If I specify '--patch-sets --files' I would expect file information for all of the patch sets of the returned changes.

I would expect to see the path to the file, the type of change (A = add, M = modified, D = Deleted, etc.), and the size of the diff (lines added, lines removed) in the output.
Jul 16, 2014
Project Member #7 zaro0508
(No comment was entered for this change.)
Status: Incomplete