Hello Maxim,

Maxim Cournoyer <maxim.courno...@gmail.com> writes:

>> so, in guix repository we include ../etc/git/gitconfig in the
>> .git/config.  I get the motivation for that, but I wanted to raise a
>> down side that I encountered today.  I have fetched the upstream Guix
>> and went on to merge the updates, but got a merge conflict, in the
>> etc/git/gitconfig file.
>>
>> That turned out to be somewhat unpleasant.  Magit stopped working.  Git
>> command line stopped working:
>>
>> --8<---------------cut here---------------start------------->8---
>> $ git status
>> fatal: bad config line 10 in file .git/../etc/git/gitconfig
>> --8<---------------cut here---------------end--------------->8---
>>
>> Once you realize what went wrong, it is not *that* hard to fix, but it
>> still was somewhat unpleasant surprise.
>
> What went wrong? Could you give in more details how you got into such a
> situation? I did change the value of format.useAutoBase in 958bc01404
> yesterday, it seems it triggered that for you? But I do not understand
> how.

I am running my own fork of Guix with couple of patches, and one of them
was removing the useAutoBase setting, since it simply did not work from
the fork.  Therefore the result of trying to merge the upstream changes
was a conflict.  This is expected.

--8<---------------cut here---------------start------------->8---
diff --cc etc/git/gitconfig
index 784136396f,4dc2f69606..0000000000
--- a/etc/git/gitconfig
+++ b/etc/git/gitconfig
@@@ -7,6 -7,7 +7,12 @@@
  [format]
          forceinbodyfrom = true  # help preserve commit authorship
          thread = shallow
++<<<<<<< HEAD
++||||||| 868825bc86
++        useAutoBase = true
++=======
+         useAutoBase = whenAble
++>>>>>>> upstream/master
  
  [pull]
          rebase = true
--8<---------------cut here---------------end--------------->8---

What was not expected is that it broke git, since the included
etc/git/gitconfig was no longer valid configuration file:

--8<---------------cut here---------------start------------->8---
$ git status
fatal: bad config line 10 in file .git/../etc/git/gitconfig
--8<---------------cut here---------------end--------------->8---

Again, I get the original motivation in world of git-send-email and
debbugs, but with Codeberg, all the things in the etc/git/gitconfig file
are just nice to have local things, and maybe would suffice to be
documented in the Contributing section of the manual.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

Reply via email to