[Libreoffice] About merging and people not paying attention

Thomas Arnhold thomas at arnhold.org
Fri Jul 29 02:46:21 PDT 2011


On 07/29/2011 11:01 AM, Miklos Vajna wrote:
> On Wed, Jul 27, 2011 at 03:53:18PM +0200, Thomas Arnhold<thomas at arnhold.org>  wrote:
>> I think this was not intended. Simple solution would be to add some
>> '<<<<<<<  HEAD' .* '=======' .* '>>>>>>>  master' stuff to git hooks. So
>> git would block commits with conflicts.
>
> Good idea - care to send a patch? The pre-commit hook is at
> git-hooks/pre-commit in bootstrap.git.

Yeah, I've already found that file. Strangely we already have such a 
check: 
http://cgit.freedesktop.org/libreoffice/bootstrap/tree/git-hooks/pre-commit#n61

And this check works! I've added a suspicious line to a random file 
'<<<<<<< HEAD' and git commit won't accept this with the according error 
message.

So if you do a simple 'git commit' you won't be able to commit those 
lines. But if you are in a merge conflict and have to run 'git add FILE' 
and 'git rebase --continue' those lines are accepted. That's why Bjoerns 
merge had those in there...

So I tried to add an additional hook 'pre-rebase' (see attachment), but 
it doesn't work. This is a modification of 'pre-commit'. Maybe the 
problem occurs on 'git add FILE' and not at the step 'git rebase 
--continue'. But for 'git add' there are no hooks as far as I know.

You could try to reproduce it:

git reset --hard HEAD~1
generate a merge conflict
git commit
git pull -r
git add ...
git rebase --continue
...

Thomas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pre-rebase
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110729/3c066779/attachment.asc>


More information about the LibreOffice mailing list