Skip to content
Snippets Groups Projects
Commit 9e47dd10 authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

debuggitdir: add new command

This is useful for interacting with the Git repository directly,
either from shell scripts, the terminal, or perhaps an alias like
this:

[alias]
git=!GIT_DIR=$(hg debuggitdir) git "$@"

...and with that, you can easily access features not offered by
Dulwich such as `hg git gc`.
parent c56eb178
No related branches found
No related tags found
No related merge requests found
Pipeline #13006 passed with warnings
......@@ -259,6 +259,12 @@
repo.githandler.clear()
@command(b'debuggitdir')
def gitdir(ui, repo):
'''get the root of the git repository'''
repo.ui.write(os.path.normpath(repo.githandler.gitdir), b'\n')
@command(b'gverify',
[(b'r', b'rev', b'', _(b'revision to verify'), _(b'REV'))],
_(b'[-r REV]'))
......
......@@ -3,6 +3,8 @@
$ hg init hgrepo
$ cd hgrepo
$ hg debuggitdir
$TESTTMP/hgrepo/.hg/git
$ echo alpha > alpha
$ hg add alpha
$ fn_hg_commit -m "add alpha"
......@@ -33,6 +35,8 @@
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo "[git]" >> .hg/hgrc
$ echo "intree = True" >> .hg/hgrc
$ hg debuggitdir
$TESTTMP/gitrepo/.git
$ hg gexport
do some work
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment