<div dir="ltr">Looks good.<div><br></div><div>What about getting packages that don't have any semver tags initially?</div><div>For eg I create a package and want to use it in a different package while also developing the original package and I did a `git init` but not `git tag v0.0.1`?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 4, 2016 at 1:37 AM, Max Howell <span dir="ltr"><<a href="mailto:max.howell@apple.com" target="_blank">max.howell@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi everyone,<div><br></div><div>I’d like to move this forward, I have the following points for discussion:</div><div><br></div><div>-----------</div><div><br></div><div>I would like to suspend this proposal’s submission pending update support which is due to be implemented after xcodeproj lands (which is done).</div><div><br></div><div>My rationale is: it impacts this proposal</div><div><br></div><div>-----------</div><div><br></div><div>I would like to suggest that the lockfile be placed as so:</div><div><br></div><div> Packages/Lockfile</div><div><br></div><div>For me this fulfills the best of both worlds: it no longer seems to be a UNIX-style lockfile for the Package.swift file *and* it more clearly shows what precisely is being locked while continuing the perhaps unwise tradition of naming the file a “lockfile”</div><div><br></div><div>-----------</div><div><br></div><div>I would like to propose that initially the method that is used for altering branches, origins and pinning versions is not given an explicit CLI UI and instead the user must use explicit git commands in their Packages directory to set the “locks”.</div><div><br></div><div>The benefit here is that the process we are using is transparent, which allows developers more power over this feature and enables greater understanding over what happens.</div><div><br></div><div>Once the modifications are made the lock file can be regenerated by executing a command (TBD). Trying to run swift-build with modifications without first generating the lock results in a prominent warning, or perhaps even an error (TBD).</div><div><br></div><div>-----------</div><div><br></div><div>I would like the propose that any local changes to cloned packages that are NOT pinned to a commit are diff’d and the diff be embedded in the lockfile. This ensures that we:</div><div><br></div><div>1) Encourage users to edit, fix and improve their packages</div><div>2) Their changes get checked in and thus other people using the Package absolutely will get these changes without them having to explicitly publish their changes somewhere accessible to their whole team.</div><div><br></div><div><br><div><blockquote type="cite"><span class=""><div>On Dec 14, 2015, at 10:43 AM, Ankit Agarwal <<a href="mailto:ankit@ankit.im" target="_blank">ankit@ankit.im</a>> wrote:</div><br></span><div><div dir="ltr"><div><br></div><div>Hi,</div><div><br></div><div><div class="h5"><div>Here is a proposal of the adding git branch support feature in SPM</div><div><br></div><div><b>Introduction</b></div><div><br></div><div>Pointing to branch or a commit ref for dependencies in Package.swift as opposed to only a tagged release.</div><div><br></div><div><b>Motivation</b></div><div><br></div><div>* Try a package which is almost stable or useable but not yet ready for a release/pre-release so not tagged (eg: new feature being introduced by a library)</div><div>* While developing packages, one would want to point a package that uses the package to a develop branch (eg: Developing Foo package, Bar uses Foo and wants to point Foo dep to develop branch)</div><div>* One would want to point to his own fork but not create a release while developing/testing (eg: Fork a library not compatible with SPM to make it compatible)</div><div>* One wants to point to some commit but doesn't have a branch/tag created for that</div><div><br></div><div><b>Proposed solution</b></div><div><br></div><div>Allow refs and branch in Package.swift</div><div><br></div><div>let package = Package(</div><div> name: "Hello",</div><div> dependencies: [</div><div> .Package(url: "ssh://<a href="http://git@example.com/Greeter.git" target="_blank">git@example.com/Greeter.git</a>", branch: "develop", shouldFastForward: true),</div><div> .Package(url: "ssh://<a href="http://git@example.com/FooBar.git" target="_blank">git@example.com/FooBar.git</a>", commit: "d8ec7ca398a3ac3990477028117384d05ca7734e"),</div><div> ]</div><div>)</div><div><br></div><div><b>Detailed design</b></div><div><br></div><div>* Only the root Package.swift would be able to use branch/ref feature to avoid dependency hell, any other dependency fetched in current Package should not compile if that dependency contains another dependency pointing to a branch/ref</div><div>* This feature should strictly be used for testing/developing purpose and should not be deployed to production environments</div><div><br></div><div>SPM could have the following behavior when running `swift build` :</div><div><br></div><div>* If pointed to a branch, there might be two use cases </div><div>Since there is a high probability that user wants to point a branch due to active development of that dep and wants latest ref available in that branch</div><div>If a dependency is not cloned, clone it and checkout that branch</div><div>If shouldFastForward is on -> Always try to be on the latest ref, disregard any local changes made to the checked out package</div><div>If shouldFastForward is false -> Always try to be on the latest ref unless any local changes made to the checked out package</div><div><br></div><div>* If pointed to a ref : </div><div>If that dependency is not cloned, clone it and checkout that ref.</div><div>Consecutive `swift build` will not affect the cloned package</div><div>If changes are made in the cloned repo, rebuild that package with those changes</div><div><br></div><div><b>Impact on existing code</b></div><div><br></div><div>None as this will be a new functionality</div><div><br></div><div><b>Alternatives considered</b></div><div><br></div><div>One option is to only allow a commit ref and not a branch so SPM will not have to worry about fast forwarding but this is a desired feature.</div></div></div></div></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ankit<br><br></div>
</div>