Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitProcessor: run git branch from a specified directory instead of working directory #1538

Open
root-talis opened this issue Mar 10, 2021 · 1 comment
Labels

Comments

@root-talis
Copy link

When running a script from cron it is very possible that the working directory will not match the script directory. In this case, instead of logging the git version, GitProcessor logs this:

fatal: not a git repository (or any of the parent directories): .git
[2021-03-10 10:26:46] channel.LEVEL: Something happened [] {"git":[]}

This happens every time something is logged. Not only this is unhelpful, but it is also annoying because analyzing such logs becomes an issue: fatal is a keyword by which one might want to filter their logs.

It would be nice to make it possible to specify the directory in which git branch should be run, for example via a configuration value passed to the constructor.

@Seldaek
Copy link
Owner

Seldaek commented Apr 4, 2021

I guess as a workaround you could make sure to call $gitProcessor([]) early in your process before you change the directory, to make sure the cache is populated.

But otherwise if you like to send a PR adding a new $path option, that sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants