Closed anderco closed 8 years ago
Hum, I have removed that parameter before (to work by with the versions of the packages in Ubuntu 14.04 LTS). I guess the justification invoked isn't actually true!
commit 74039877a755711bea370e200984acbb2334b07c Author: Damien Lespiau damien.lespiau@intel.com Date: Wed Nov 11 12:42:05 2015 +0000
git-pw: Make git-pw work with older versions of GitPython
The search_parent_directories parameter is relatively new and older
versions of GitPython don't have it. The default was, and still is, to
recurse in parent directories so we don't actually need to specify it at
all.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
So https://github.com/dlespiau/patchwork/commit/a6423f354d5d7a9eae28b4ed03cef43a262cc125 seems to work here and supports older versions of GitPython, would you mind me committing that version instead of yours?
Hum no, still does work for older versions of GitPython when calling git-pw from the directory (nor any of its parent) that isn't a git repo. Back to square one :)
Alright, another try checking git.__version__
to decide what to do:
https://github.com/dlespiau/patchwork/commit/e6224528fc48e5b44b41a298207b1456944067c7
Ok pushed the last attempt, seems to work. Do shout if I got something wrong and sorry to not have taken your patch, but I need git-pw to run on the previous Ubuntu LTS release for projects using that as base OS for their CI systems/wms/containers.
Thanks for fixing, the new solution works as expected here. I didn't know about __version__
, and it doesn't show up in GitPython's API docs. I guess I should have googled harder.
Running git-pw from a subdirectory of a repo would fail with
This is inconsistent with most git tools, so fix this by passing search_parent_directories=True to git.Repo().
Signed-off-by: Ander Conselvan de Oliveira ander.conselvan.de.oliveira@intel.com
I'm not sure this is worth the extra dependency though. I couldn't find any way to query GitPython's version and only set the parameter if the version is at least 0.3.5.