Is committing to git submodules supposed to work? I have a project which uses a git submodule. I open the project in TM, make some changes in the submodule and then commit. It looks like everything went fine but in the result window I get "Changes not staged for commit" and "no changes added to commit". Running "git status" in the submodule I see that the changes are not committed.
On Dec 11, 2014, at 3:17 AM, Jacob Carlborg doob@me.com wrote:
Is committing to git submodules supposed to work? I have a project which uses a git submodule. I open the project in TM, make some changes in the submodule and then commit. It looks like everything went fine but in the result window I get "Changes not staged for commit" and "no changes added to commit". Running "git status" in the submodule I see that the changes are not committed.
You need to set the submodule directory as the project directory (or make sure that the submodule is at the top level in the file browser) so that the commits are performed in the submodule repo. Also, you will need to create/switch to a branch in the submodule since the git TM bundle will not let you make commit on a detached HEAD (though git itself allows this).
-- /Jacob Carlborg
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 2014-12-11 15:52, Ronald Wampler wrote:
You need to set the submodule directory as the project directory (or make sure that the submodule is at the top level in the file browser) so that the commits are performed in the submodule repo. Also, you will need to create/switch to a branch in the submodule since the git TM bundle will not let you make commit on a detached HEAD (though git itself allows this).
So that means it doesn't work basically :(
On 11 Dec 2014, at 15:17, Jacob Carlborg wrote:
Is committing to git submodules supposed to work? I have a project which uses a git submodule. I open the project in TM, make some changes in the submodule and then commit. It looks like everything went fine but in the result window I get "Changes not staged for commit" and "no changes added to commit".
Do you select the files in the file browser prior to comitting?
For me, selecting files from a submodule and then running Git → Commit works.
The alternative would be to change the project folder first, as Ronald suggested. Both actions serve the purpose of directing the commit to the submodule. Without doing any of this, I don’t see my submodule’s files in the commit dialog (since we’ve initiated a commit in the parent repository).
On 2014-12-16 08:32, Allan Odgaard wrote:
Do you select the files in the file browser prior to comitting?
No.
For me, selecting files from a submodule and then running Git → Commit works.
Yeah, that works.
The alternative would be to change the project folder first, as Ronald suggested. Both actions serve the purpose of directing the commit to the submodule. Without doing any of this, I don’t see my submodule’s files in the commit dialog (since we’ve initiated a commit in the parent repository).
I can see my submodule's files, both in the diff and the commit dialog, even if no files are selected. I guess that's why I was hoping it would work.
Running the diff command it says "Uncommitted Changes for ‘./’ on branch ‘master’ ... in submodule". I'm not sure where TextMate gets that information but something is at least recognizing the changes to be in a submodule.
On 16 Dec 2014, at 20:24, Jacob Carlborg wrote:
I can see my submodule's files, both in the diff and the commit dialog, even if no files are selected. I guess that's why I was hoping it would work.
I haven’t checked, but I think the diff command recursively visits submodules with changes.
For me, the commit window does not show files from submodules.
In practice the commit command could also recursively visit submodules, but if the user selects both files in the root repository and one or more submodules, then it would have to do multiple commits, and if it does commits both in a submodule and the root repository, one might perhaps expect that the commit done in the root repository would also include updating the submodule reference.
On 2014-12-16 14:33, Allan Odgaard wrote:
I haven’t checked, but I think the diff command recursively visits submodules with changes.
For me, the commit window does not show files from submodules.
In practice the commit command could also recursively visit submodules, but if the user selects both files in the root repository and one or more submodules, then it would have to do multiple commits, and if it does commits both in a submodule and the root repository, one might perhaps expect that the commit done in the root repository would also include updating the submodule reference.
Yeah, sounds like there's no easy solution.