-
Notifications
You must be signed in to change notification settings - Fork 21
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
Committing inside a git submodule fails #33
Comments
I wanted to open up a PR to solve this issue, but I couldn't think of a straightforward and uncontroversial way to make this work. If we make it so that Using a path relative to the The best solution I can think of right now is to set Edit: Ok so I thought of a much simpler solution. I don't know why, but earlier I was thinking that the value stored for
every time we I'll see if I can work on a PR. |
This is done in order to support commiting from git submodules. Fixes rkotze#33
This is done in order to support committing from git submodules. If the repository is a submodule, then `git config commit.template` will be an absolute path to the `.gitmessage` file. If the repository is not a submodule, it will be a path relative to the repository root (consistent with current behavior). Fixes rkotze#33
This is done in order to support committing from git submodules. Fixes rkotze#33
Thanks for the detailed issue. Interesting bug. Look forward to the PR. |
Thanks for merging that change! I meant to open a PR earlier, but wanted to write some tests. Didn't get around to it, but happy to see the changes landed in the most recent version! |
I imagine there would be a lot of setup it which might make it slow. But It will be good to have a test to cover it. 👍 |
Would you be opposed to having some "integration level" tests that actually created new |
I agree it should be an integration test as it will be the most valuable test for this case. |
Prerequisites
npm i -g git-mob
)brew upgrade git
if installed with Homebrew/Linuxbrew)Description
Steps to Reproduce
Checkout
git-mob
at revision cd74de0.npm install; npm link
.Expected behavior: git opens up my
$EDITOR
with theCo-Authored-By
trailers already in my commit messageActual behavior:
Reproduces how often: Every time
Versions
git-mob --version
): 0.4.0git --version
): git version 2.20.1Additional Information
git mob ad bd
correctly updates the git config for the submodule at~/dev/parent-repo/.git/modules/child-repo/config
to includeHere,
.git/.gitmessage
is a path I think is meant to be relative to the childrepository's root (
~/dev/parent-repo/child-repo
), andgit
does appear to be trying to read the file at~/dev/parent-repo/child-repo/.git/.gitmessage
.However, because
child-repo
is a submodule,child-repo/.git
is not a directory. The.gitmessage
file is actually at~/dev/parent-repo/.git/modules/child-repo/.gitmessage
.The text was updated successfully, but these errors were encountered: