Как я справляюсь с конфликтами с подмодулями мерзавца?

Вы можете попробовать следующий подход:

-- Table
CREATE TABLE #ListOfTables (
   [TableName] varchar(max)
)
INSERT INTO #ListOfTables
   ([TableName])
VALUES
   ('Table1'),
   ('Table2'),
   ('Table3'),
   ('Table4'),
   ('Table5'),
   ('Table6'),
   ('Table7'),
   ('Table8'),
   ('Table9')

-- Statement
DECLARE @stm nvarchar(max)
SET @stm = N''

SELECT @stm = @stm + N'SELECT * FROM ' + QUOTENAME([TableName]) + N'; '
FROM #ListOfTables
/* 
-- Or using FOR XML PATH
SELECT @stm = (
   SELECT CONCAT(N'SELECT * FROM ', QUOTENAME([TableName]), N'; ')
   FROM #ListOfTables
   FOR XML PATH('')
)    
*/

PRINT @stm
EXEC sp_executesql @stm
107
задан Pod 10 September 2009 в 10:45
поделиться

2 ответа

I have not seen that exact error before. But I have a guess about the trouble you are encountering. It looks like because the master and one.one branches of supery contain different refs for the subby submodule, when you merge changes from master git does not know which ref - v1.0 or v1.1 - should be kept and tracked by the one.one branch of supery.

If that is the case, then you need to select the ref that you want and commit that change to resolve the conflict. Which is exactly what you are doing with the reset command.

This is a tricky aspect of tracking different versions of a submodule in different branches of your project. But the submodule ref is just like any other component of your project. If the two different branches continue to track the same respective submodule refs after successive merges, then git should be able to work out the pattern without raising merge conflicts in future merges. On the other hand you if switch submodule refs frequently you may have to put up with a lot of conflict resolving.

20
ответ дан 24 November 2019 в 03:41
поделиться

Ну, технически это не управление конфликтами с подмодулями (то есть: оставьте это, но не то), но я нашел способ продолжить работу ... и все, что мне нужно было сделать, это обратить внимание на мой git status выводит и сбрасывает подмодули:

git reset HEAD subby
git commit

Это сбрасывает подмодуль на фиксацию до извлечения. Что в данном случае именно то, что я хотел. А в других случаях, когда мне нужны изменения, применяемые к подмодулю, я буду обрабатывать их с помощью стандартных рабочих процессов подмодуля (мастер оформления заказа, извлечение желаемого тега и т. Д.).

78
ответ дан 24 November 2019 в 03:41
поделиться
Другие вопросы по тегам:

Похожие вопросы: