peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 147 forks source link

[fix] non working git detection if you are outside root directory #31

Closed niedbalski closed 10 years ago

niedbalski commented 10 years ago

If you are working on a non-root directory path, git detection fails. fixed.

peritus commented 10 years ago

Thanks for the patch!

I want to understand your use case. I always thought people either version one repository at once (w/ .bumpversion.cfg at the git root) or multiple folders below that level (where git-repo-versioning doesn't make sense).

Or does bumpversion crash when invoked in the wrong folder (is there an error message?)?

Also, if you could throw in a regression test, that would be terrific (sorry, I've been wearing my Office Space T-Shirt all day)

Sent from my pocket calculator

On 16 Dec 2013, at 15:01, Jorge Niedbalski notifications@github.com wrote:

If you are working on a non-root directory path, git detection fails. fixed.

You can merge this Pull Request by running

git pull https://github.com/niedbalski/bumpversion master Or view, comment on, or merge it at:

https://github.com/peritus/bumpversion/pull/31

Commit Summary

[fix] non working git detection if you are outside root directory File Changes

M bumpversion/init.py (15) Patch Links:

https://github.com/peritus/bumpversion/pull/31.patch https://github.com/peritus/bumpversion/pull/31.diff

niedbalski commented 10 years ago

Hello @peritus

The use case is a git repo with several python packages inside , each one with a separated version schema and setup.py, in that case the git detection failed and apparently by default it tried to use hg, which is incorrect on this case because this sub directory is on the git tree.

repo/
repo/package/.bumpversion.cfg
repo/package1/.bumpversion.cfg
repo/package2/.bumpversion.cfg

Let me know if you can see my use case.

niedbalski commented 10 years ago

Hey @peritus are you OK with this change ?

peritus commented 10 years ago

Your usecase seems valid, I just have to find time to verify and write a regression test.

Sent from my pocket calculator

On 19 Dec 2013, at 16:48, Jorge Niedbalski notifications@github.com wrote:

Hey @peritus are you OK with this change ?

— Reply to this email directly or view it on GitHub.

niedbalski commented 10 years ago

Hey @peritus , regressions added and passing, also some code re-factoring has been made.

Waiting for your merge approval :+1:

niedbalski commented 10 years ago

Any other change is required?

peritus commented 10 years ago

Thanks for your efforts.

I still don't have an idea how bump version fails in which situation. The patch you attached tests new code, is there a test (or a step-by-step way to reproduce) that shows where it fails (preferably with a stack trace) ?

peritus commented 10 years ago

Found a simpler fix based on your work. It's in master now, you can test it by installing the current master:

pip install https://github.com/peritus/bumpversion/archive/master.zip#egg=bumpversion-dev

Let me know if this fixes your problem.