Allow the Git repository path to be specified.

Labels: area/cli kind/feature

Timeline

Steve Moyer (smoyer64) opened

In support of git-bug's use as a tool (similar to what's described in #828), this issue promotes composability by allowing the calling program to specify the Git repository's path. This should be accomplished in the same manner as using the -C flag with the git command. Separate handling of the Git directory and working tree, similar to using the Git --git-dir and --work-tree flags are out-of-scope (at least for the time being.)

For reference, the relevant portion of the documentation for Git's -C flag is:

Run as if git was started in instead of the current working directory. When multiple -C options are given, each subsequent non-absolute -C is interpreted relative to the preceding -C . If is present but empty, e.g. -C "", then the current working directory is left unchanged.

Steve Moyer (smoyer64) added label enhancement

Steve Moyer (smoyer64) added label go

Steve Moyer (smoyer64) added label kind/feature

Steve Moyer (smoyer64) added label area/commands

sudoforge commented

Copying my review comment here for posterity:

this is already a supported workflow using git's -C flag:

➜ cd $(mktemp -d)


➜ git init .
Initialized empty Git repository in /tmp/tmp.5DzuMyMWOO/.git/


➜ git bug user new -e 'no-reply@sudoforge.com' -n 'sudoforge' --non-interactive
Building cache...

9d2b85433bc7775128e778a1c122c1efc23a748dd035c30dcea673f5d6833e20
➜ cd $(mktemp -d)


➜ pwd
/tmp/tmp.gOrmIEBMtc


➜ git -C /tmp/tmp.5DzuMyMWOO bug user
9d2b854 sudoforge

is there any particular reason you want to add support for this to git-bug?

sudoforge removed label enhancement

sudoforge removed label go

sudoforge added label area/cli

sudoforge removed label area/commands