Bug 444072 - jgit ls-remote should support -h/--heads and -t/--tags
Summary: jgit ls-remote should support -h/--heads and -t/--tags
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2014-09-15 05:34 EDT by Muhammad Ichsan CLA
Modified: 2014-12-27 18:31 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Muhammad Ichsan CLA 2014-09-15 05:34:05 EDT
->> git ls-remote -h http://localhost/hola.git HEAD

Expected (this case, it's not found)
--------
fatal: repository 'http://localhost/hola.git/' not found


Fact
----
jgit ls-remote uri-ish [--help (-h)] [--timeout SERVICE]

 --help (-h)       : display this help text
 --timeout SERVICE : abort connection if no activity
Comment 1 Robin Stocker CLA 2014-09-15 06:34:16 EDT
So when -h is specified in `git ls-remote -h`, it means --help. When it is specified with other arguments, it means --heads.

Place to implement this: Class LsRemote. Probably best to use LsRemoteCommand, which already has setHeads and setTags methods for this.

Patches for this are welcome, please see contributor guide:
https://wiki.eclipse.org/EGit/Contributor_Guide
Comment 2 Matthias Sohn CLA 2014-11-23 18:58:54 EST
pushed patches for review

use LsRemoteCommand: https://git.eclipse.org/r/#/c/36890/
add option --heads:  https://git.eclipse.org/r/#/c/36891/
add option --tags:   https://git.eclipse.org/r/#/c/36892/
Comment 3 Matthias Sohn CLA 2014-12-27 18:31:24 EST
(In reply to Matthias Sohn from comment #2)
> pushed patches for review
> 
> use LsRemoteCommand: https://git.eclipse.org/r/#/c/36890/
https://git.eclipse.org/r/#/c/37382/
merged as 816de9e9fae04260edd8e288c150e6f148fd04ce

> add option --heads:  https://git.eclipse.org/r/#/c/36891/
https://git.eclipse.org/r/#/c/37383/
merged as 490660a7c61d6226ac52d0e00198dd90a3891115

> add option --tags:   https://git.eclipse.org/r/#/c/36892/
https://git.eclipse.org/r/#/c/37384/
merged as 8812e6f3f60dc6bc86ba57c3e82288780f735f6b