1

I am using gerrit as my code review and git system. And now I am trying to get only the files of a certain patchset in gerrit,excluding the other files in git repository. Is there any way to do this,like a git command or sth ?

For instance ,Here is a patchset ,Now I want download only the nine files changed in this commit, What can I do to make it?

3
  • your question does not seem to make much sense. what exactly do you want?
    – mvp
    Commented Jun 6, 2013 at 9:09
  • I've update the question trying to make it clear. Commented Jun 6, 2013 at 9:22
  • 1
    gerrit is not gitweb. it may provide you patches, but does not necessarily provide you full copies of files, ever. you still need to repo sync or git pull to get your files. in that case, just use local git commands to get what you need, no reason to download anything from gerrit web inteface
    – mvp
    Commented Jun 6, 2013 at 9:26

2 Answers 2

2

Have you thought about using the gerrit query command?

You can use ssh -p 29418 [email protected] gerrit query --current-patch-set 123 --files

This give you the list of files that have change for that patchset 123. It is possible to format the output as JSON for easier processing.

For more details see the documentation.

1
  • Although gerrit query is useful, this doesn't give you the contents of the files. It will tell you which files have been added/modified/deleted. It can also give you the size of the change. But it doesn't give you the actual file.
    – Ankur
    Commented Feb 7, 2015 at 10:14
1

Not sure what the question is exactly about. Maybe you are looking for:

git log --name-only

In git there is no "download". You only clone a complete repository and fetch new commits afterwards.

Once you have a local clone of the repository you are able access all files ever created in that repository.

If you want the content of a file in a given commit you can say something like:

git show a90b68ab485d795d3fb1f5220eb7851b21583ccd:sources/host-tools/gdb-pretty-printers/stlport/gppfs-0.2/COPYING
2
  • Thks, Can copy the nine files to another folder using git command ? Commented Jun 6, 2013 at 9:36
  • No, git is not for copying files. - But cp is. ;)
    – michas
    Commented Jun 6, 2013 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.