commercialhaskell / commercialhaskell/stack
unnecessary git clone when updating package commit sha
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
Steps to reproduce:
1. put this in some project's stack.yaml:
```
packages:
- '.'
- location:
git: git://github.com/tfausak/strive.git
commit: cfbd995dacafb1242482c0b6ce23826fad505338
extra-dep: true
```
2. `stack build`
3. change commit to `c39704d5f008af42f5c3c2d5319476c7aa12e52d`
4. `stack build` again
Expected results:
- the second stack build does just `git remote update; git reset --hard`
Actual results:
```
2016-01-07 14:06:07.661449: [debug] Run process: git clone git://github.com/tfausak/strive.git /home/tomi/src/strava-gear/.stack-work/downloaded/5727e3e6b7fab4ac5241b42c7d83482fbddc6f05b1b698540df4ab681225a8ee.git.tmp/ @(stack_1RV4odVDW2e8SkMJA1Z8Zb:System.Process.Read src/System/Process/Read.hs:255:3)
2016-01-07 14:06:13.978009: [debug] Run process: git reset --hard c39704d5f008af42f5c3c2d5319476c7aa12e52d @(stack_1RV4odVDW2e8SkMJA1Z8Zb:System.Process.Read src/System/Process/Read.hs:255:3)
```
This means whenever I want to update the dep, the entire git repository is cloned over the network again. That's not very good. :-(
I may use git submodules as a workaround, but it's not nice.
Contributor guide
Assessment
This issue has not been assessed yet.