Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335703 - Add setCredentialsProvider to org.eclipse.jgit.api.PullCommand
Summary: Add setCredentialsProvider to org.eclipse.jgit.api.PullCommand
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.11   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.11   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 334120
  Show dependency tree
 
Reported: 2011-01-28 11:48 EST by Tomasz Zarna CLA
Modified: 2011-01-31 05:26 EST (History)
1 user (show)

See Also:


Attachments
Fix (1.33 KB, text/plain)
2011-01-28 11:48 EST, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.