Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend github sourcing to any git repo #284

Closed
jonathanmorley opened this issue Oct 22, 2014 · 27 comments
Closed

Extend github sourcing to any git repo #284

jonathanmorley opened this issue Oct 22, 2014 · 27 comments

Comments

@jonathanmorley
Copy link

There should be support for any git repository to be sourced as a package.

This could be done with a similar syntax to npm:

git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish

@forki
Copy link
Member

forki commented Oct 22, 2014

how does npm handle the download? does it assume git is in path?

@dnauck
Copy link
Contributor

dnauck commented Oct 22, 2014

@forki don't forget that Paket is used mostly on Windows. So users don't have git installed but some GUI clients with internal git, etc. You should not compare it with tools for unix platforms where everything is in path.

@khellang
Copy link
Contributor

So users don't have git installed but some GUI clients with internal git, etc.

LOL. That's not true at all. Even if you use GitHub for Windows, you still have git in your PATH.

@forki
Copy link
Member

forki commented Oct 22, 2014

I don't think paket is mostly used on Windows, but yes git is not
everywhere yet.
We support the github repo because it's easy to download. Https get +
unzip. Done
On Oct 22, 2014 9:42 AM, "Daniel Nauck" [email protected] wrote:

@forki https://github.com/forki don't forget that Paket is used mostly
on Windows. So users don't have git installed but some GUI clients with
internal git, etc. You should not compare it with tools for unix platforms
where everything is in path.


Reply to this email directly or view it on GitHub
#284 (comment).

@dnauck
Copy link
Contributor

dnauck commented Oct 22, 2014

@khellang I don't know why you get personal, but the default for msysgit on Windows it to be not on PATH:

image

@forki If you target .NET developers with Paket than it is mostly used on Windows. So just check if git is in PATH, if not fallback to NGit or whatever

@jonathanmorley
Copy link
Author

https://www.npmjs.org/doc/misc/npm-config.html#git

git
Default: "git"
Type: String
The command to use for git commands. If git is installed on the computer, but is not in the PATH, then set this to the full path to the git binary.

npm has a config option where you can give it a path to git if its not in your path

@forki
Copy link
Member

forki commented Oct 22, 2014

That's exactly how we do it in FAKE. Seems the way to go.
On Oct 22, 2014 8:32 PM, "Jonathan Morley" [email protected] wrote:

https://www.npmjs.org/doc/misc/npm-config.html#git

git
Default: "git"
Type: String
The command to use for git commands. If git is installed on the computer,
but is not in the PATH, then set this to the full path to the git binary.

npm has a config option where you can give it a path to git if its not in
your path


Reply to this email directly or view it on GitHub
#284 (comment).

@yannisgu
Copy link
Contributor

Maybe using libgit2sharp would be better than using git command?

  • No assumpotion about git installation
  • Cleaner API probably (.NET vs exec)
  • Better error handling with exceptions

Not sure what's better..

But 👍 for the idea!

@AlexZeitler
Copy link
Contributor

👍

@caindy
Copy link
Contributor

caindy commented Jan 5, 2015

Is this the right place to (suggest / ask for) support for private github repos?

@isaacabraham
Copy link
Contributor

@caindy Probably a new issue I would've thought? @forki

@ilkerde
Copy link
Contributor

ilkerde commented Mar 2, 2015

I strongly support this feature to be implemented with "git in path". If git is not available, paket can politely tell the user to require it.

Thanks for your work!

@forki
Copy link
Member

forki commented Jan 5, 2016

There is a first alpha version available. This feature will come with Paket v3.

@forki forki removed the up-for-grabs label Jan 5, 2016
@CumpsD
Copy link
Contributor

CumpsD commented Jan 8, 2016

Are you using LibGitSharp now? If so, I thought it didn't support SSH repositories, or has that changed?

@caindy
Copy link
Contributor

caindy commented Jan 8, 2016

@CumpsD according to the documentation

This feature assumes that you have git installed. If you don't have git installed then Paket still allows you to reference files from github.

@CumpsD
Copy link
Contributor

CumpsD commented Jan 8, 2016

@caindy yes I know, I was referring to the comment of @yannisgu higher in this thread who proposed libgit2sharp, upon which my mind sprung to the fact it apparently doesn't wrap ssh yet.

@forki
Copy link
Member

forki commented Jan 8, 2016

We use the installed git.exe
On Jan 8, 2016 20:37, "David Cumps" [email protected] wrote:

@caindy https://github.com/caindy yes I know, I was referring to the
comment of @yannisgu https://github.com/yannisgu higher in this thread
who proposed libgit2sharp, upon which my mind sprung to the fact it
apparently doesn't wrap ssh yet.


Reply to this email directly or view it on GitHub
#284 (comment).

@jschiefer
Copy link

I have been playing with this and have a little trouble understanding the use model. I want to pull down a whole git repository, so I put a "git" line into the paket.depedencies and install, and it does that just fine. But where do I go from here?

I expected I would run a build using the build:"build.cmd" syntax, and then somehow be able to refer to the build artifacts in the appropriate paket.references files. From looking at the code, it appears that the file: syntax in paket.references would be one way this might work. Or is building a Nuget file as described at the bottom of http://fsprojects.github.io/Paket/git-dependencies.html the correct way to do this?

Background: I was hoping to use Paket as an easy way to switch between binary (NuGet) and source (git repo) references for individual packages, for cases where you occasionally need to debug into a library..

@forki
Copy link
Member

forki commented Jan 12, 2016

At the moment the only supported way is building nuget packages. But we
also want to allow more use cases. What do you want to achieve? Referencing
dlls
?
On Jan 12, 2016 07:19, "Jan Schiefer" [email protected] wrote:

I have been playing with this and have a little trouble understanding the
use model. I want to pull down a whole git repository, so I put a "git"
line into the paket.depedencies and install, and it does that just fine.
But where do I go from here?

I expected I would run a build using the build:"build.cmd" syntax, and
then somehow be able to refer to the build artifacts in the appropriate
paket.references files. From looking at the code, it appears that the file:
syntax in paket.references would be one way this might work. Or is building
a Nuget file as described at the bottom of
http://fsprojects.github.io/Paket/git-dependencies.html the correct way
to do this?

Background: I was hoping to use Paket as an easy way to switch between
binary (NuGet) and source (git repo) references for individual packages,
for cases where you occasionally need to debug into a library..


Reply to this email directly or view it on GitHub
#284 (comment).

@jschiefer
Copy link

Yes, referencing assemblies. Let's say in my fsproj I have a reference to a dependent assembly that I satisfied via Paket/NuGet. I would be able right-click on the reference in the solution explorer and select a "get source" menu entry, which would, via Paket, retrieve the source repository for the dependent assembly, load its corresponding csproj file and replace any reference to the binary with a project reference throughout the solution. Bascially a low-friction way to go from binary/Nuget to source/git and back as needed.

@forki
Copy link
Member

forki commented Jan 12, 2016

how about this (potential feature):

in paket.references:

// project: paket-files/.../MyNuGet.csproj
// MyNuGet

By uncommenting one of the two lines and running "paket install" you could enable the corresponding setting.

@forki
Copy link
Member

forki commented Jan 12, 2016

maybe we can do it in the same line!?

@jschiefer
Copy link

Initially this sounded like a good proposal, but let's think about the implications:

I assume there would need to be two entries for MyNuGet in the paket.dependencies: one for the Nuget, and one for the source, and they would need to be tied together somehow. The "obvious" assumption that the NuGet package name corresponds to the git repository name is probably invalid.

Which git commit would Paket select on install or update? Initially, you would want whatever is specified in paket.dependencies. But if you switch to source, you would eventually make changes, so now your local repository under paket-files is in a different state. Then what should Paket do on install or update? Should an update change the version specification in paket.lock to be different from paket.dependencies?That doesn't sound right...

Also, what if you had two references to MyNuGet in different projects, where one used the NuGet binary and the other used the source version from git, you'd end up with two different versions of MyNuGet in the end, which is not what you want. So maybe the switching needs to happen in paket.dependencies, not paket.references, for that reason?

Should we discuss this in #334?

@forki
Copy link
Member

forki commented Jan 12, 2016

yes #334 is better place

@forki
Copy link
Member

forki commented Apr 6, 2016

Implemented in v3

@forki forki closed this as completed Apr 6, 2016
@Thorium
Copy link
Member

Thorium commented Aug 30, 2018

How do I reference a private git (e.g. Bitbucket) repo? Will it ask password on every build or can it be set as env variable? https://fsprojects.github.io/Paket/git-dependencies.html didn't have any info of private repositories...

@forki
Copy link
Member

forki commented Aug 31, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests