Subject: Bizarre git merge behaviour

From: Matthew Cengia <[email-masked]>
Date: Wed, 20 Nov 2013 03:49:36 +0000 (UTC)

The other day I was merging a feature branch (shown below as
origin/22869-new-kernel) into my staging release (shown below as 'wtf'),
and it *reverted* a bucket-load of changes I'd made on other branches
which had been merged into staging before. I can't for the life of me
work out why this happened, and would appreciate any ideas. Output below
shows symptoms:

  mattcen@sonar:prisonpc(wtf)$ git log --numstat --oneline origin/22869-new-kernel ^wtf | cat
  a8879c2 Oops, name .config consistently with deb.
  2797    0       client/kernel/config-3.5.7.20-1
  0       2797    client/kernel/config-3.5.7.21-1
  4c34686 Further lock down the inmate kernel.
  366     1094    client/kernel/config-3.5.7.21-1
  -       -       client/kernel/linux-firmware-image_3.5.7.21-1_i386.deb
  -       -       client/kernel/linux-image-3.5.7.20_3.5.7.20-1_i386.deb
  -       -       client/kernel/linux-image-3.5.7.21_3.5.7.21-1_i386.deb
  6       7       client/scm/50-kernel-prisoner.scm
  4a8acd0 Add build notes about how we generated these kernels.
  37      0       client/kernel/README
  e96adfe Merge remote-tracking branch 'origin/NNNNN-multicast-kernel' into 22869-new-kernel
  4b8afeb Merge commit '8ef01f2' into 22869-new-kernel
  fc4a5e6 Allow staff machines to receive IPTV stuff (per russm).
  1       0       client/scm/50-staff.scm
  117e646 Merge remote branch 'origin/staging' into NNNNN-multicast-kernel
  deb3b38 allow IGMP reports out through iptables
  1       0       client/scm/20-security.scm
  8ef01f2 Enable multicast in inmate kernel.
  0       3034    client/kernel/config-2.6.32.46+drm33.20
  3036    0       client/kernel/config-2.6.32.61+drm33.26
  -       -       client/kernel/linux-firmware-image_2.6.32.46+drm33.20-1_all.deb
  -       -       client/kernel/linux-firmware-image_2.6.32.61+drm33.26-1_all.deb
  -       -       client/kernel/linux-image-2.6.32.46+drm33.20_2.6.32.46+drm33.20-1_i386.deb
  -       -       client/kernel/linux-image-2.6.32.61+drm33.26_2.6.32.61+drm33.26-1_i386.deb
  11      11      client/scm/50-prisoner.scm
  mattcen@sonar:prisonpc(wtf)$ git merge origin/22869-new-kernel
  Auto-merging tca/parts.d/pxelinux-cfg
  Auto-merging pre-install.sh
  Removing ppcadm/templates/wwwfilter.tpl
  Removing ppcadm/templates/streaming_media.tpl
  Removing ppcadm/templates/disc_summary.tpl
  Removing ppcadm/templates/disc_access.tpl
  Auto-merging ppcadm/modules/quarantine.py
  CONFLICT (content): Merge conflict in ppcadm/modules/quarantine.py
  Auto-merging ppcadm/modules/media.py
  CONFLICT (content): Merge conflict in ppcadm/modules/media.py
  CONFLICT (modify/delete): ppcadm/modules/emailstats.py deleted in origin/22869-new-kernel and modified in HEAD. Version HEAD of ppcadm/modules/emailstats.py left in tree.
  Removing generate-mail-stats
  Removing doc/adminguide/images/streaming_media-screen.png
  Auto-merging debian/rules
  Auto-merging debian/prisonpc-internet.install
  CONFLICT (content): Merge conflict in debian/prisonpc-internet.install
  Auto-merging debian/prisonpc-core.cron.d
  Auto-merging debian/NEWS
  CONFLICT (content): Merge conflict in debian/NEWS
  Auto-merging client/scm/50-kernel-prisoner.scm
  CONFLICT (content): Merge conflict in client/scm/50-kernel-prisoner.scm
  Removing client/kernel/linux-image-3.5.7.21_3.5.7.21-1_i386.deb
  Removing client/kernel/linux-firmware-image_3.5.7.21-1_i386.deb
  Auto-merging client/kernel/config-3.5.7.20-1
  Resolved 'client/scm/50-kernel-prisoner.scm' using previous resolution.
  Resolved 'debian/NEWS' using previous resolution.
  Resolved 'debian/prisonpc-internet.install' using previous resolution.
  Resolved 'ppcadm/modules/media.py' using previous resolution.
  Resolved 'ppcadm/modules/quarantine.py' using previous resolution.
  Automatic merge failed; fix conflicts and then commit the result.
  mattcen@sonar:prisonpc(wtf)$ git status --porcelain
  M  client/kernel/README
  R  client/kernel/config-3.5.7.21-1 -> client/kernel/config-3.5.7.20-1
  D  client/kernel/linux-firmware-image_3.5.7.21-1_i386.deb
  A  client/kernel/linux-image-3.5.7.20_3.5.7.20-1_i386.deb
  D  client/kernel/linux-image-3.5.7.21_3.5.7.21-1_i386.deb
  M  client/scm/20-security.scm
  M  client/scm/30-apps.scm
  UU client/scm/50-kernel-prisoner.scm
  M  client/scm/50-staff.scm
  UU debian/NEWS
  M  debian/changelog
  M  debian/prisonpc-core.cron.d
  UU debian/prisonpc-internet.install
  M  debian/rules
  A  doc/adminguide/images/streaming_media-screen.jpg
  D  doc/adminguide/images/streaming_media-screen.png
  M  doc/adminguide/images/web_filtering.png
  M  doc/adminguide/streaming_media.rst
  M  doc/adminguide/system-status.rst
  M  doc/adminguide/web_filtering.rst
  M  dovecot/dovecot-staff.conf
  M  eric/apps/complain.py
  M  eric/apps/links.py
  M  eric/apps/media.py
  M  eric/apps/whitelist.py
  M  eric/eric
  M  eric/eric_cfg.py
  D  generate-mail-stats
  M  ppcadm/modules/disc_access.py
  UD ppcadm/modules/emailstats.py
  UU ppcadm/modules/media.py
  UU ppcadm/modules/quarantine.py
  M  ppcadm/modules/wwwfilter.py
  M  ppcadm/resources/admin.css
  D  ppcadm/templates/disc_access.tpl
  D  ppcadm/templates/disc_summary.tpl
  M  ppcadm/templates/home.tpl
  D  ppcadm/templates/streaming_media.tpl
  M  ppcadm/templates/user.tpl
  D  ppcadm/templates/wwwfilter.tpl
  M  pre-install.sh
  M  tca/parts.d/pxelinux-cfg
  ?? old/
  ?? paste
  mattcen@sonar:prisonpc(wtf)$

- -- 
Regards,
Matthew Cengia