innogames/igcommit

On submodule problem

BBNoodle opened this issue · 7 comments

I used "git submodule add - B URL Src / pages / SPD" and submitted ". Git modules" file and "Src / pages / SPD" file at the same time, so the following error occurred:

subprocess.CalledProcessError : Command'['/opt/gitlab/embedded/libexec/git-core/git', 'cat-file', '-s', '*********************************']' returned non-zero exit status 128.

Hi @BBNoodle,
We actually never have tested it with sub modules good catch. I'll give it a try later and see if I can provide and easy fix or if that requires more work.

thanks very much.

I just tested it locally on my computer with a submodule with the following commands:

# Clone igcommit as our main repository
git clone git@github.com:innogames/igcommit.git
cd igcommit

# Add sub directories to match your setup
mkdir -p src/pages

# Now add a submodule with a branch (I will use igcommit for simplification) where
# -b specified the branch migrate_tag (I guess your capital B is a typo ?)
git submodule add -b migrate_tag git@github.com:innogames/igcommit.git src/pages/igcommit-pages

# Add and commit the submodule
git add .
git commit -m "Added submodule"

# Run igcommit to check if it works with submodules
git log --reverse --oneline HEAD~15..HEAD |     sed 's:\([^ ]*\) .*:\1 \1 refs/heads/master:' | python ./igcommit-receive

I am getting the output as expected:

=== CheckCommitSummary on 25df9dd ===
WARNING: commit summary longer than 50 characters

=== CheckContributors on 96272bd..96272bd ===
NOTICE: contributor of commit 96272bd has a email address with a new domain "innogames.com" 

...

The error message you get returned non-zero exit status 128:

subprocess.CalledProcessError : Command'['/opt/gitlab/embedded/libexec/git-core/git', 'cat-file', '-s', '*********************************']' returned non-zero exit status 128.

hints into the direction that git cat-file fails to output the file. Since you masked it I can't say anything about it. Can you please make sure 2 things:

  1. Please make sure you added the submodule properly (maybe try cloning it somewhere else)
  2. Make sure you can run git cat-file -s <YOUR_MASKED_FILE> without errors.

My current guess would be that the file is something special like a binary or so that igcommit tries to parse but shouldn't/can't. In that case you might need to tell igcommit to ignore these files.

The file I need to submit is a binary file, so do I need to tell igcommit to ignore it? Then how do I need to operate? Thank you for your answer!

That was my assumption. But I just checked igcommit for calls of cat-file and the only place we have is:

and here we use git cat-file with a -p parameter and not with a -s parameter like in your error message.

Are you sure the error is caused by igcommit and not something else - can you please try pushing your changes without igcommit (or igcommit disabled) - does it pass ?

Additionally I tried to commit a binary in the main repository and in the submodule on my local computer and it worked. What kind of binary is this ?

I probably know the question. Thank you for answering it for me

Sure no problem. Let us know if you find issues related to igcommit.