Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335703

Summary: Add setCredentialsProvider to org.eclipse.jgit.api.PullCommand
Product: [Technology] EGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: CoreAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: caniszczyk
Version: 0.11   
Target Milestone: 0.11   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 334120    
Attachments:
Description Flags
Fix none

Description Tomasz Zarna CLA 2011-01-28 11:48:09 EST
Created attachment 187853 [details]
Fix

In EFS implementation backed by git we use in Orion I'm setting a custom CredentialsProvider before doing 'call' on PushCommand and FetchCommand. It would be convenient if I was able to do the same thing before calling PullCommand. Is there a reason why the last command is missing the setter? I'm attaching a patch that fixes it. Not sure if this is a proper way of contributing patches to git, though.
Comment 1 Chris Aniszczyk CLA 2011-01-28 11:50:34 EST
The best way to contribute patches is via our Gerrit instance on egit.eclipse.org

http://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches

Can you do that?
Comment 2 Tomasz Zarna CLA 2011-01-28 12:34:22 EST
http://egit.eclipse.org/r/#change,2371

I hope I didn't mess up anything, this is my first contribution to EGit :)
Comment 3 Chris Aniszczyk CLA 2011-01-28 12:37:24 EST
Looks good, just one small problem that you can fix and push up to Gerrit again.

Make sure you include the proper

'Change-Id: Id9713a4849c772e030fca23dd64b993264f28366' in the commit message so Gerrit knows what to do :)
Comment 4 Tomasz Zarna CLA 2011-01-28 13:09:53 EST
The other setters also call 'checkCallable' before setting a new provider. Should I do the same thing?
Comment 5 Tomasz Zarna CLA 2011-01-28 13:14:18 EST
btw, wanted to answer you on Gerrit, but haven't figured out how to submit a comment. It stays at "Draft" no matter what I do.

I will have to reset to the last commit from origin/master (egit.eclipse.org) before committing (with proper comment) and pushing again, right?
Comment 6 Chris Aniszczyk CLA 2011-01-28 14:10:53 EST
Yes, add checkCallable.

There's a couple ways to do it... but here's one way from the CLI...

1) ensure you're on master
2) git checkout -b 2371
3) git pull http://egit.eclipse.org/r/p/jgit refs/changes/71/2371/1
4) < make some fixes >
5) git commit --amend (ensure you add the Change-Id: #, see other commits for an an example)
6) git push review

When you pull, you may need to rebase on master depending what has happened.

Let me know if this works for you:)
Comment 7 Chris Aniszczyk CLA 2011-01-28 15:08:28 EST
Fixed with 9fbda2239202ca9d3a20c84d7326f47c667aa920.
Comment 8 Tomasz Zarna CLA 2011-01-31 05:26:49 EST
Thanks, I promise I'll do better next time.