Skip to content

Allow the Git repository path to be specified. #1467

Open

Description

@smoyer64

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.

Activity

  1. self-assigned this
    on May 29, 2025
  2. sudoforge commented on May 29, 2025

    @sudoforge
    Contributor

    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 '[email protected]' -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?

  3. added
    area/cliRelates to the CLI
    and removed
    goPull requests that update Go code
    on May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/cliRelates to the CLIkind/featureRelates to a new feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions