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

Git version resolution for path-based dependency #1306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

llucenic
Copy link

@llucenic llucenic commented Dec 10, 2017

It is fairly legal in case of a git submodule that .git is a regular file. Git accepts this file in its --git-dir parameter in git describe. Thus rendering the isDir() check in determineVersionWithGIT(NativePath path) being counter-effective.

This PR partially fixes #1303.

It is fairly legal in case of a git submodule that .git is a regular file. Git accepts this file in its --git-dir parameter in `git describe`. Thus rendering the isDir() check here being counter-effective.
@dlang-bot
Copy link
Collaborator

dlang-bot commented Dec 10, 2017

Thanks for your pull request and interest in making D better, @llucenic! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

@llucenic llucenic changed the title Git version resolution for path-based dependecy Git version resolution for path-based dependency Feb 28, 2018
@llucenic
Copy link
Author

Please help me with the interpreting of failing checks. I do not understand what should be changed in order to pass them.

@wilzbach
Copy link
Member

Don't worry about Jenkins it used to be very unstable in the last few months thought this got better over the last weeks as we started to look into the failures more carefully.
AppVeyor is just a download failure.

Anyhow, I'm sorry that this got lost in the queue.
I see your point for removing the check, but it would be much stronger if your PR would be accompanied by a unittest for it. This would greatly help to prevent regressions in this matter ;-)

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is harmless change anyhow - even if git_dir doesn't exist, the method will still return null and with verbose logging an error message. Though of course there's the penalty of invoking git

@llucenic
Copy link
Author

I will write a unit test, but frankly I have no idea how it should look like in a change like this :-)

@wilzbach
Copy link
Member

but frankly I have no idea how it should look like in a change like this :-)

Have a look at e.g. https://github.com/dlang/dub/blob/master/test/4-describe-data-1-list.sh

Essentially you create a the layout that's needed to reproduce this in test (like e.g. https://github.com/dlang/dub/blob/master/test/describe-dependency-2/dub.json) and then add a test as bash script.
I think it's best to do this from master, s.t. your bash script fails with master and once it does you switch to your branch and it should pass.
For git submodules, I think the easiest is to create them in a temporary directory that's nuked with a bash trap (I'm not sure whether all CI scripts do a --recursive clone atm).
Otherwise there's also e.g. https://github.com/dlang-community/gitcompatibledubpackage

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

Successfully merging this pull request may close these issues.

'dub describe' does not respect overrides nor path-based dependencies
3 participants