johnny-deps
johnny-deps copied to clipboard
report all conflicts rather than just the first
If a conflict is present, then jd reports only the first it finds. Because of this my workflow is something like this:
$ jd update A
conflict in B
$ cd B; jd update B; git commit -a -m "dep update";git push; cd A
$ jd update A
conflict in C
$ cd C; jd update C; git commit -a -m "dep update";git push; cd A
$ jd update A
conflict in D
$ cd D; jd update D; git commit -a -m "dep update";git push; cd A
$ jd update A
conflict in E
...
Would it be possible/easy to show all conflicts so I can fix them all at once?
@gkristic
We can do better, yeah.
I originally thought about doing this but then decided not to, to avoid a large and difficult to read output message. Notice that Johnny Deps is listing all packages importing a common revision, to let you contrast with the offending package. The message could be shortened, but at the cost of losing that information. It wasn't immediately clear to me which approach was the most useful, so I preferred to wait for field data :) But after some usage, I agree with showing as many conflicts as possible at once.
However, keep in mind that, even if we show all conflicts at once, solving them all doesn't mean you won't get any when you run jd
again later. You could as well be introducing more conflicts when trying to fix those the tool reported, and that's something jd
can't evaluate in advance.
I'll work on this tomorrow, probably.
Right now we are at one extreme - report the first conflict and then halt.
$jd update A
Version mismatch detected for X
1aaaf referenced by:
B
C
but 2aaf referenced by D
At the other extreme we would be reporting all dependencies that are in conflict and all reasons for the conflict. Something like:
$jd update A
Version mismatch detected for X
1aaaf referenced by:
B
C
but 2aaaf referenced by D
but 3aaaf referenced by E
but 4aaaf referenced by F
AND
Version mismatch detected for Y
1bbbd referenced by:
C
D
but 2bbbd referenced by F
but 3bbbd referenced by G
AND
...
From my experience today, it would be good to handle one conflict at a time, but all files associate with that one conflict. This is half way between the above examples.
$jd update A
Version mismatch detected for X
1aaaf referenced by:
B
C
but 2aaaf referenced by D
but 3aaaf referenced by E
but 4aaaf referenced by F
With this I would change D, E, and F to use the same version of X as B and C and then I would run jd update again and work on Y and Z.
I'm changing to a VC-specific Github account. @gkristic-vc will take it from here.