Per https://github.com/iterative/dvc.org/pull/244#discussion_r275607398, requested by @shcheklein
Currently dvc diff outputs a line such as
dvc diff from 6a819f8fa053f124f6a5487efc824a8c17366c71 to 612f6caf5c5daeb172167db285efd8b169d41b60
with the full-length commit hashes. Can we just print the first 7 characters like Git and GitHub support?
Ping @efiop what do you think? If you approve, I can try to implement this myself and send a PR. Any tips on what source code to focus on will be appreciated if so.
@jorgeorpinel Great idea! All diff-related logic is in dvc/repo/diff.py dvc/command/diff.py and dvc/scm/git/__init__.py pretty much. The part that needs adjusting is most likely in dvc/scm/git/__init__.py::Git::get_diff_trees. Thanks for looking into it :slightly_smiling_face: Let us know if you need any additional help with this patch.
@jorgeorpinel thanks! 馃憤 do you want to assign it to yourself?
Thanks @efiop. I do need some more guidance. Questions:
pip install -r requirements.txt but when how do I run that local copy of DVC? To test my changes.dvc/scm/git/__init__.py::Git::_get_diff_trees haspython
from gitdb.exc import BadObject, BadName
gitdb in requirements.txt and b) I can't find gitdb.exc in the gitdb API ref. Is the exc module maybe from an older version of gitdb? I'm a bit lost with that one, sorry.@jorgeorpinel I think this a good starting point to setup dev environment - https://dvc.org/doc/user-guide/contributing
https://github.com/gitpython-developers/GitPython pulls gitdb with it. I'm not sure about the version though.
Thanks Ivan!
I followed the contributing guide which was quite straightforward, thanks. This allowed me to test my small change locally and it seems it works. Here's the PR: https://github.com/iterative/dvc/pull/1906
Regarding gitdb I do see it in the reqs of gitpython now, thanks. And it is a pretty outdated version it seems (0.6.4 while the latest is 2.0.5 atm) But still I can't find the exc module in that old version's API ref. Oh well, don't really need that.