[TYPO3-dev] Troubles with submodules in Git

Peter Niederlag typo3-list at niekom.de
Wed Oct 5 22:12:34 CEST 2011


Hello,

Am 05.10.2011 15:49, schrieb Dmitry Dulepov:
> Applico:~/Projects/TYPO3/TYPO3-master$ git fetch
> ssh://dmitry@review.typo3.org:29418/TYPO3v4/Core refs/changes/78/1778/2
> && git cherry-pick FETCH_HEAD
> From ssh://review.typo3.org:29418/TYPO3v4/Core
>  * branch            refs/changes/78/1778/2 -> FETCH_HEAD
> error: could not apply accf4bb... [BUGFIX] Removed dependency on
> TYPO3_MODE in saltedpasswords
> hint: after resolving the conflicts, mark the corrected paths
> hint: with 'git add <paths>' or 'git rm <paths>'
> hint: and commit the result with 'git commit'

hmm... I get a slightly different message (git version 1.7.2.5) but I
think it is the same issue:

----------------
warning: too many files (created: 687 deleted: 913), skipping inexact
rename detection
Automatic cherry-pick failed.  After resolving the conflicts,
mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
and commit the result with:

        git commit -c accf4bb5252309fda20870224f6a592ac12489f6

---------------
> Applico:~/Projects/TYPO3/TYPO3-master$ git st
> # On branch issue_22881
> # Changes to be committed:
> #
> #    modified:  
> typo3/sysext/saltedpasswords/sv1/class.tx_saltedpasswords_sv1.php
> #
> # Unmerged paths:
> #   (use "git add/rm <file>..." as appropriate to mark resolution)
> #
> #    added by us:        typo3/sysext/dbal
> #    added by us:        typo3/sysext/extbase
> #    added by us:        typo3/sysext/fluid
> #    added by us:        typo3/sysext/version
> #    added by us:        typo3/sysext/workspaces

It is bascically very simple. ;)

The patch is pretty old, dating back to 2011-04. At that time theses
paths ^^^^ were not managed by submodules. For that reason the patch now
will ~replace(overload) the submodules by replacing them with the old
files content.

Git tells you what you should do:
<cite>git add/rm <file>..</cite>
since we don't want those changes we will use git rm:

git rm typo3/sysext/dbal
git rm typo3/sysext/extbase
...
# no slash at the end!

now only the changed file should be in there (weird thing though IMO,
git add or even git add . work the same).

git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:
typo3/sysext/saltedpasswords/sv1/class.tx_saltedpasswords_sv1.php
#

I can now commit (and use the old commit message) via:
git commit -c accf4bb5252309fda20870224f6a592ac12489f6
Voila, the patch is now updated and could be sent to review again. :->

> Now I have a broken branch due to submodules :( Normally I can fix it by
> going to each submodule, making git reset --hard and than git submodule
> --init from the base directory. But this time it is broken completely
> and I cannot fix it.

This is due that the submodule is not broken but is replaced by some
content. This is to be solved by removing those changes from the index
(staging area) via git rm.

> Does anybody have a 100% working way with those submodules? Please,
> share, I am getting desperate.

You have it yourself, but the patch messes it up as it is just darn old....

Actually I admit it is quite tricky and not always obvious. ;(

hth and Greets,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *




More information about the TYPO3-dev mailing list