#41 gin/git, working with branches

Open
opened 3 years ago by jcolomb · 4 comments

Update: working with gin and git can make problems, especially git commit will call git annex command once gin is initialised, and some git gui may not be able to access git annex command, making them fail to commit.

It is the second time I try to work with branches and fail. I am not sure what went wrong.

I created a branch on the browser on one submodule, I used gin intit on the submodule locally.

Then I used sourcetree to change branch.

I did changes, and then tried to commit, but that won't work... apparently git annex gives problem

I think it is due to issues with git annex not working with sourcetree git commands... I wonder if it is a branch problem, or is it due to sourcetree use.

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/ds/f__1wvcd1rg0n4c_23xh68rr0000gp/T/SourceTreeTemp.JbSwCc 
git-annex smudge --clean -- 'protocol_database/animals.html': git-annex: command not found
error: external filter 'git-annex smudge --clean -- %f' failed 127
error: external filter 'git-annex smudge --clean -- %f' failed
git: 'annex' is not a git command. See 'git --help'.
Completed with errors, see above

I had the same problem once and finally copy-pasted the change in the master branch...

> Update: working with gin and git can make problems, especially git commit will call git annex command once gin is initialised, and some git gui may not be able to access git annex command, making them fail to commit. It is the second time I try to work with branches and fail. I am not sure what went wrong. I created a branch on the browser on one submodule, I used `gin intit` on the submodule locally. Then I used sourcetree to change branch. I did changes, and then tried to commit, but that won't work... apparently git annex gives problem I think it is due to issues with git annex not working with sourcetree git commands... I wonder if it is a branch problem, or is it due to sourcetree use. ``` git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/ds/f__1wvcd1rg0n4c_23xh68rr0000gp/T/SourceTreeTemp.JbSwCc git-annex smudge --clean -- 'protocol_database/animals.html': git-annex: command not found error: external filter 'git-annex smudge --clean -- %f' failed 127 error: external filter 'git-annex smudge --clean -- %f' failed git: 'annex' is not a git command. See 'git --help'. Completed with errors, see above ``` I had the same problem once and finally copy-pasted the change in the master branch...
julien colomb commented 3 years ago
Poster

interestingly, using gin upload . works: the changes were committed to the right branch.

SO it seems it is a problem to use git commit when gin is initialised ?

interestingly, using `gin upload .` works: the changes were committed to the right branch. SO it seems it is a problem to use git commit when gin is initialised ?
julien colomb commented 3 years ago
Poster

pull request won't do it automatically, though, no clue why: https://gin.g-node.org/larkumlab/larkumlab_commons/pulls/4

pull request won't do it automatically, though, no clue why: https://gin.g-node.org/larkumlab/larkumlab_commons/pulls/4
Achilleas Koutsou commented 3 years ago
Owner

We generally don't recommend mixing git and gin workflows, but usually it's okay for small stuff. Adding sourcetree into that mix makes things a bit less predictable, but probably still okay if it just runs plain git commands in the background.

From the output you posted, it looks like sourcetree runs in an environment where git-annex isn't in its $PATH, which makes sense since /usr/local, where homebrew installs applications, isn't a standard path for GUI apps.

This becomes a problem when doing git add or git commit, because git-annex adds smudge filters to repositories, which makes some git operations call git annex commands automatically. So when sourcetree runs git commit, that in turn runs git-annex smudge --clean ..., but git-annex isn't available in sourcetree's environment.

We generally don't recommend mixing git and gin workflows, but usually it's okay for small stuff. Adding sourcetree into that mix makes things a bit less predictable, but probably still okay if it just runs plain git commands in the background. From the output you posted, it looks like sourcetree runs in an environment where git-annex isn't in its `$PATH`, which makes sense since `/usr/local`, where homebrew installs applications, isn't a standard path for GUI apps. This becomes a problem when doing `git add` or `git commit`, because git-annex adds smudge filters to repositories, which makes some git operations call git annex commands automatically. So when sourcetree runs `git commit`, that in turn runs `git-annex smudge --clean ...`, but `git-annex` isn't available in sourcetree's environment.
julien colomb commented 3 years ago
Poster

I was expecting something like this...

Maybe we should work the doc to define better how to use git clients with gin repositories. Interestingly, here sourcetree is making problems, Rstudio handle commit and push without problems.

That may be important for the data_analysis folder in tonic: people will want to use their favorite git gui for it.

I was expecting something like this... Maybe we should work the doc to define better how to use git clients with gin repositories. Interestingly, here sourcetree is making problems, Rstudio handle commit and push without problems. That may be important for the data_analysis folder in tonic: people will want to use their favorite git gui for it.
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.