Gerrit and LFS diffing

77 views
Skip to first unread message

Markus Duft

unread,
Oct 17, 2017, 7:03:38 AM10/17/17
to Repo and Gerrit Discussion
Hey,

I'm playing a little with LFS support in Gerrit. I'm building all myself, we have a little un-recent stable-2.14 gerrit (f083894) along with (also a little un-recent) lfs plugin stable-2.14 (4bbca9e). I managed to configure the LFS repository, and (using the command line client) everything seems to work (commit, push, clone/fetch, checkout). But when reviewing changes in gerrit, the diff of those files will diff the LFS pointer file, instead of the actual file contents. Is there any plans to change/improve this?

Another issue I have with the LFS setup is that pushing over HTTP always asks for credentials (for LFS pushes). I saw that there is a way to authenticate over SSH somehow and obtain a token for HTTP pushes. How is it possible to configure this for command line git and or JGit?

Thanks,
Markus

David Pursehouse

unread,
Oct 17, 2017, 8:36:06 AM10/17/17
to Markus Duft, Repo and Gerrit Discussion
On Tue, Oct 17, 2017 at 8:03 PM Markus Duft <duft....@gmail.com> wrote:
Hey,

I'm playing a little with LFS support in Gerrit. I'm building all myself, we have a little un-recent stable-2.14 gerrit (f083894) along with (also a little un-recent) lfs plugin stable-2.14 (4bbca9e). I managed to configure the LFS repository, and (using the command line client) everything seems to work (commit, push, clone/fetch, checkout). But when reviewing changes in gerrit, the diff of those files will diff the LFS pointer file, instead of the actual file contents. Is there any plans to change/improve this?


The entire handling of large files is offloaded to the LFS backend and as far as Gerrit is concerned the file is only a short text file. I don't think it would be trivial to make Gerrit able to access and diff the contents.

 
Another issue I have with the LFS setup is that pushing over HTTP always asks for credentials (for LFS pushes). I saw that there is a way to authenticate over SSH somehow and obtain a token for HTTP pushes. How is it possible to configure this for command line git and or JGit?


For command line pushes the git-lfs client will use authentication from the ~/.netrc file, and gerrit will accept that authentication if the remote URL includes the /a/ part.

For example the http remote on my local test project is:


and I have an entry in ~/.netrc:

machine localhost login admin password xxxxredactedxxxx

(the password is the http password from the user settings)

 
Thanks,
Markus

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Markus Duft

unread,
Oct 19, 2017, 9:12:13 AM10/19/17
to Repo and Gerrit Discussion
Am Dienstag, 17. Oktober 2017 14:36:06 UTC+2 schrieb David Pursehouse:
On Tue, Oct 17, 2017 at 8:03 PM Markus Duft <duft....@gmail.com> wrote:
Hey,

I'm playing a little with LFS support in Gerrit. I'm building all myself, we have a little un-recent stable-2.14 gerrit (f083894) along with (also a little un-recent) lfs plugin stable-2.14 (4bbca9e). I managed to configure the LFS repository, and (using the command line client) everything seems to work (commit, push, clone/fetch, checkout). But when reviewing changes in gerrit, the diff of those files will diff the LFS pointer file, instead of the actual file contents. Is there any plans to change/improve this?


The entire handling of large files is offloaded to the LFS backend and as far as Gerrit is concerned the file is only a short text file. I don't think it would be trivial to make Gerrit able to access and diff the contents.

OK, so I guess we will have to life with the limitation for the time being :)
 
 
Another issue I have with the LFS setup is that pushing over HTTP always asks for credentials (for LFS pushes). I saw that there is a way to authenticate over SSH somehow and obtain a token for HTTP pushes. How is it possible to configure this for command line git and or JGit?


For command line pushes the git-lfs client will use authentication from the ~/.netrc file, and gerrit will accept that authentication if the remote URL includes the /a/ part.

For example the http remote on my local test project is:


and I have an entry in ~/.netrc:

machine localhost login admin password xxxxredactedxxxx

(the password is the http password from the user settings)

Ah, nice, thanks :) Is there also way to use this SSH based authentication? My ideal scenario would be that LFS push obtains an authentication token from gerrit by using the LFS plugins authentication mechanism (over SSH command line) - after all somebody must have had an Idea how to use this when implementing it, right? I just don't see how this could be integrated into command line (or even better: JGit) LFS. When using SSH to obtain the token I can later on pass over HTTP, I would completely eliminate the need to have any password on the client side...

Jacek Centkowski

unread,
Oct 19, 2017, 10:32:19 AM10/19/17
to Repo and Gerrit Discussion
On Thursday, 19 October 2017 15:12:13 UTC+2, Markus Duft wrote:
Am Dienstag, 17. Oktober 2017 14:36:06 UTC+2 schrieb David Pursehouse:
On Tue, Oct 17, 2017 at 8:03 PM Markus Duft <duft....@gmail.com> wrote:
Hey,

I'm playing a little with LFS support in Gerrit. I'm building all myself, we have a little un-recent stable-2.14 gerrit (f083894) along with (also a little un-recent) lfs plugin stable-2.14 (4bbca9e). I managed to configure the LFS repository, and (using the command line client) everything seems to work (commit, push, clone/fetch, checkout). But when reviewing changes in gerrit, the diff of those files will diff the LFS pointer file, instead of the actual file contents. Is there any plans to change/improve this?


The entire handling of large files is offloaded to the LFS backend and as far as Gerrit is concerned the file is only a short text file. I don't think it would be trivial to make Gerrit able to access and diff the contents.

OK, so I guess we will have to life with the limitation for the time being :)
 
 
Another issue I have with the LFS setup is that pushing over HTTP always asks for credentials (for LFS pushes). I saw that there is a way to authenticate over SSH somehow and obtain a token for HTTP pushes. How is it possible to configure this for command line git and or JGit?


For command line pushes the git-lfs client will use authentication from the ~/.netrc file, and gerrit will accept that authentication if the remote URL includes the /a/ part.

For example the http remote on my local test project is:


and I have an entry in ~/.netrc:

machine localhost login admin password xxxxredactedxxxx

(the password is the http password from the user settings)

Ah, nice, thanks :) Is there also way to use this SSH based authentication? My ideal scenario would be that LFS push obtains an authentication token from gerrit by using the LFS plugins authentication mechanism (over SSH command line) - after all somebody must have had an Idea how to use this when implementing it, right? I just don't see how this could be integrated into command line (or even better: JGit) LFS. When using SSH to obtain the token I can later on pass over HTTP, I would completely eliminate the need to have any password on the client side...

This is how it actually works:
1. clone repo over SSH protocol
2. in terms of LFS it will authorise over SSH and receive a token
3. that token Git LFS client uses to actually download data over HTTP from Gerrit

Is this what you want to achieve?

Regards
Jacek

Markus Duft

unread,
Oct 20, 2017, 7:05:06 AM10/20/17
to Repo and Gerrit Discussion
Am Donnerstag, 19. Oktober 2017 16:32:19 UTC+2 schrieb Jacek Centkowski:
On Thursday, 19 October 2017 15:12:13 UTC+2, Markus Duft wrote:

 
Another issue I have with the LFS setup is that pushing over HTTP always asks for credentials (for LFS pushes). I saw that there is a way to authenticate over SSH somehow and obtain a token for HTTP pushes. How is it possible to configure this for command line git and or JGit?


For command line pushes the git-lfs client will use authentication from the ~/.netrc file, and gerrit will accept that authentication if the remote URL includes the /a/ part.

For example the http remote on my local test project is:


and I have an entry in ~/.netrc:

machine localhost login admin password xxxxredactedxxxx

(the password is the http password from the user settings)

Ah, nice, thanks :) Is there also way to use this SSH based authentication? My ideal scenario would be that LFS push obtains an authentication token from gerrit by using the LFS plugins authentication mechanism (over SSH command line) - after all somebody must have had an Idea how to use this when implementing it, right? I just don't see how this could be integrated into command line (or even better: JGit) LFS. When using SSH to obtain the token I can later on pass over HTTP, I would completely eliminate the need to have any password on the client side...

This is how it actually works:
1. clone repo over SSH protocol
2. in terms of LFS it will authorise over SSH and receive a token
3. that token Git LFS client uses to actually download data over HTTP from Gerrit

Is this what you want to achieve?


Nearly :) I already can download LFS artifacts from Gerrit without authentication. However I cannot /upload/ artifacts without entering username and password.

Regards,
Markus
Reply all
Reply to author
Forward
0 new messages