{"thread":{"id":"6077","subject":"newbie question - git-pull and local branch merge","startedAt":"2006-12-22T10:27:54Z","lastAt":"2006-12-22T20:43:16Z","messageCount":4,"participants":["Pelle Svensson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"30041","messageId":"6bb9c1030612220227h2dc83a78u2e31e0f4e6801412@mail.gmail.com","threadId":"6077","inReplyTo":null,"subject":"newbie question - git-pull and local branch merge","fromName":"Pelle Svensson","fromEmail":"pelle2004@gmail.com","sentAt":"2006-12-22T10:27:54Z","receivedAt":"2006-12-22T10:27:54Z","isPatch":false,"sender":{"key":"pelle2004@gmail.com","avatar":null},"body":"Hi,\n\nI'm quiet new to git and I have done this so far:\n\n1. Installed git-1.4.4\n2. pulled linus kernel tree.\n3. Created a local branch 'git-checkout my stuff'\n4. Edit a number of files.\n5. git-commit -a\n6. git-pull\n7. Edit a couple more files.\n8. git-pull <- Problem!\n\nAccidentally I had 2 files not committed and one of these also\nhad changes in the git-pull master branch which git could\nnot merge automatically.\n\nChanges has been done but I'm not fully convinced what has happen.\nI see that files has been changed and the failing merge file need's\nto be edit.\n\nThe really question I need answer is how can I see what changes\nhas been done in the master branch (the one pulled in) of the\nfile I suppose to merge manually. Is there no way to get out\nthe 2 last versions from the master branch and supply them to\nKDiff3 or similarly diff program.\n\nAlso by reading the documentation I wounder what the difference is of:\n\n- commit and check-in, seem to be same thing.\n- update index-file and update the repository.\n\n/Thanks\n"},{"id":"30042","messageId":"7vejqs1a3r.fsf@assigned-by-dhcp.cox.net","threadId":"6077","inReplyTo":"6bb9c1030612220227h2dc83a78u2e31e0f4e6801412@mail.gmail.com","subject":"Re: newbie question - git-pull and local branch merge","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-22T10:46:48Z","receivedAt":"2006-12-22T10:46:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Pelle Svensson\" <pelle2004@gmail.com> writes:\n\n> 8. git-pull <- Problem!\n\nAnd the problem is...???\n\n> Accidentally I had 2 files not committed and one of these also\n> had changes in the git-pull master branch which git could\n> not merge automatically.\n\nSo you had changes to fileA that you already committed, and\nfurther changes in your working tree, and Linus side updated\nthat same file since you started working on it?\n\nIf that is the case, I suspect that the pull stopped saying\nsomething like \"Entry ... not uptodate. Cannot merge.\"  If that\nis the case I think your working tree has what you had before\nyou started the pull.  Deal with your own changes in the files\nyou dirtied (say, commit them first) and pull again.\n\nOtherwise, what happened was you had changes to fileB that you\nalready committed, and Linus side also updated the same file in\nthe meantime, and you did _not_ have any change to that fileB in\nyour working tree (you might have had some other files locally\nmodified).  And the pull would have reported something like\n\"CONFLICT (content)\" in such a case.\n\n$ git diff\n\nwill show you an output that looks like diff but not really (you\ncan tell by its hunk header that have three '@' letters instead\nof normal two); you have a conflicted merge result, and have the\nusual conflict markers in that file.  Edit the file to resolve\nconflict.  Then say:\n\n$ git update-index conflicted-file-1.c conflicted-file-2.c ...\n$ git commit\n\nto record the merge commit.  Do not update-index the files that\nyou had your own changes before pulling -- those changes do not\nhave anything to do with this merge and you do not want to\nrecord them as part of the merge.\n"},{"id":"30044","messageId":"6bb9c1030612220326w6ce88d0ar1ca5ca49b306c71e@mail.gmail.com","threadId":"6077","inReplyTo":"7vejqs1a3r.fsf@assigned-by-dhcp.cox.net","subject":"Re: newbie question - git-pull and local branch merge","fromName":"Pelle Svensson","fromEmail":"pelle2004@gmail.com","sentAt":"2006-12-22T11:26:50Z","receivedAt":"2006-12-22T11:26:50Z","isPatch":false,"sender":{"key":"pelle2004@gmail.com","avatar":null},"body":"Problem is that git-pull failed to merge closed to what you describe in case 2\nand I really like to know hat has been done between the 2 last versions\non the Linus side.\n\nThe problematic file is include/asm-arm/system.h\n\nI attached some output below. Last (D) is a file diff between the time when\nI first pulled the Linus tree and a copy of that which I'm now working in.\nI think the resolve/edit part is easy because Linus tree seem to added\nan extern declaration of 'adjust_cr' closed to line 152 and the other\nconflict code (++<<<...) should be removed.\n\nBut is it not possible to show changes/diff version by version of\nwhat has been done in the Linus tree?\n\nCan you tell me if the last pull of Linus code is in the repository\nor not. For me it looks like it is because all related files are touched.\n\n/Thanks\n\nA. git-status output\nB. git-diff output\nC. And if I do git-pull again\nD. diff output between file stamp 12-dec and 21-dec\n\nA. git-status output\n============\n\n# On branch refs/heads/ep93xx-pmp\n#\n# Updated but not checked in:\n#   (will commit)\n#\n#\tmodified: Documentation/block/biodoc.txt\n#\tmodified: Documentation/kernel-parameters.txt\n#\tmodified: Documentation/powerpc/booting-without-of.txt\n#\tmodified: Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl\n#\tmodified: MAINTAINERS\n#\tmodified: arch/arm/configs/ep93xx_defconfig\n#\tmodified: arch/arm/configs/iop13xx_defconfig\n#\tmodified: arch/arm/configs/iop32x_defconfig\n#\tmodified: arch/arm/configs/iop33x_defconfig\n#\tmodified: arch/arm/configs/ixp2000_defconfig\n#\tmodified: arch/arm/configs/ixp23xx_defconfig\n#\tmodified: arch/arm/configs/lpd270_defconfig\n#\tmodified: arch/arm/configs/onearm_defconfig\n#\tmodified: arch/arm/kernel/calls.S\n#\tmodified: arch/arm/kernel/setup.c\n#\tmodified: arch/arm/kernel/sys_arm.c\n#\tmodified: arch/arm/mach-iop13xx/iq81340mc.c\n#\tmodified: arch/arm/mach-iop13xx/iq81340sc.c\n#\tmodified: arch/arm/mach-iop13xx/irq.c\n#\tmodified: arch/arm/mach-iop13xx/setup.c\n#\tmodified: arch/arm/mach-s3c2410/Kconfig\n#\tmodified: arch/arm/mach-s3c2410/cpu.c\n#\tmodified: arch/arm/mach-s3c2410/devs.c\n#\tmodified: arch/arm/mach-s3c2410/dma.c\n#\tmodified: arch/arm/mach-s3c2410/irq.h\n#\tmodified: arch/arm/mach-s3c2410/mach-anubis.c\n#\tmodified: arch/arm/mach-s3c2410/mach-bast.c\n#\tmodified: arch/arm/mach-s3c2410/mach-h1940.c\n#\tmodified: arch/arm/mach-s3c2410/mach-n30.c\n#\tmodified: arch/arm/mach-s3c2410/mach-nexcoder.c\n#\tmodified: arch/arm/mach-s3c2410/mach-osiris.c\n#\tmodified: arch/arm/mach-s3c2410/mach-otom.c\n#\tmodified: arch/arm/mach-s3c2410/mach-smdk2410.c\n#\tmodified: arch/arm/mach-s3c2410/mach-smdk2413.c\n#\tmodified: arch/arm/mach-s3c2410/mach-smdk2440.c\n#\tmodified: arch/arm/mach-s3c2410/mach-vr1000.c\n#\tmodified: arch/arm/mach-s3c2410/mach-vstms.c\n#\tmodified: arch/arm/mach-s3c2410/pm-simtec.c\n#\tmodified: arch/arm/mach-s3c2410/pm.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2410-clock.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2410-dma.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2410-pm.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2410.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2412-clock.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2412-dma.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2412.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2440-clock.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2440-dma.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2440.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2440.h\n#\tmodified: arch/arm/mach-s3c2410/s3c2442-clock.c\n#\tmodified: arch/arm/mach-s3c2410/s3c2442.c\n#\tmodified: arch/arm/mach-s3c2410/s3c244x.c\n#\tmodified: arch/arm/mach-s3c2410/usb-simtec.h\n#\tmodified: arch/arm/mm/ioremap.c\n#\tmodified: arch/arm/mm/mmu.c\n#\tmodified: arch/arm/mm/proc-xsc3.S\n#\tmodified: arch/i386/pci/fixup.c\n#\tmodified: arch/powerpc/boot/Makefile\n#\tmodified: arch/powerpc/configs/cell_defconfig\n#\tmodified: arch/powerpc/kernel/of_platform.c\n#\tmodified: arch/powerpc/kernel/pci_64.c\n#\tmodified: arch/powerpc/kernel/prom_parse.c\n#\tmodified: arch/powerpc/kernel/signal_32.c\n#\tmodified: arch/powerpc/platforms/Makefile\n#\tmodified: arch/powerpc/platforms/cell/io-workarounds.c\n#\tmodified: arch/powerpc/platforms/cell/spu_priv1_mmio.c\n#\tmodified: arch/powerpc/platforms/iseries/Kconfig\n#\tmodified: arch/powerpc/sysdev/mpic.c\n#\tmodified: arch/x86_64/Kconfig\n#\tmodified: arch/x86_64/kernel/pci-calgary.c\n#\tmodified: block/cfq-iosched.c\n#\tmodified: block/elevator.c\n#\tmodified: block/ll_rw_blk.c\n#\tmodified: block/scsi_ioctl.c\n#\tmodified: drivers/acpi/ibm_acpi.c\n#\tmodified: drivers/ata/ahci.c\n#\tmodified: drivers/ata/libata-scsi.c\n#\tmodified: drivers/ata/pata_cs5530.c\n#\tmodified: drivers/ata/pata_via.c\n#\tmodified: drivers/ata/sata_nv.c\n#\tmodified: drivers/ata/sata_svw.c\n#\tmodified: drivers/ata/sata_vsc.c\n#\tmodified: drivers/block/cciss.c\n#\tmodified: drivers/block/viodasd.c\n#\tmodified: drivers/bluetooth/hci_usb.c\n#\tmodified: drivers/cdrom/cdrom.c\n#\tmodified: drivers/cdrom/viocd.c\n#\tmodified: drivers/char/drm/drmP.h\n#\tmodified: drivers/char/drm/drm_lock.c\n#\tmodified: drivers/char/drm/drm_stub.c\n#\tmodified: drivers/char/drm/drm_sysfs.c\n#\tmodified: drivers/char/drm/i915_irq.c\n#\tmodified: drivers/char/drm/r128_drm.h\n#\tmodified: drivers/char/drm/r128_drv.h\n#\tmodified: drivers/char/drm/r128_state.c\n#\tmodified: drivers/char/drm/r300_cmdbuf.c\n#\tmodified: drivers/char/drm/radeon_drv.h\n#\tmodified: drivers/char/drm/radeon_irq.c\n#\tmodified: drivers/char/drm/radeon_mem.c\n#\tmodified: drivers/char/drm/radeon_state.c\n#\tmodified: drivers/char/drm/savage_bci.c\n#\tmodified: drivers/char/viocons.c\n#\tmodified: drivers/char/viotape.c\n#\tmodified: drivers/ide/pci/atiixp.c\n#\tmodified: drivers/net/iseries_veth.c\n#\tmodified: drivers/pci/hotplug/acpiphp_glue.c\n#\tmodified: drivers/pci/hotplug/rpaphp_slot.c\n#\tmodified: drivers/pci/hotplug/shpchp.h\n#\tmodified: drivers/pci/hotplug/shpchp_core.c\n#\tmodified: drivers/pci/hotplug/shpchp_ctrl.c\n#\tmodified: drivers/pci/hotplug/shpchp_hpc.c\n#\tmodified: drivers/pci/htirq.c\n#\tmodified: drivers/pci/pci-driver.c\n#\tmodified: drivers/pci/pci.c\n#\tmodified: drivers/pci/pcie/portdrv_pci.c\n#\tmodified: drivers/pci/probe.c\n#\tmodified: drivers/pci/quirks.c\n#\tmodified: drivers/pci/search.c\n#\tmodified: drivers/pci/setup-res.c\n#\tmodified: drivers/scsi/scsi_lib.c\n#\tmodified: drivers/usb/class/usblp.c\n#\tmodified: drivers/usb/core/devio.c\n#\tmodified: drivers/usb/gadget/at91_udc.c\n#\tmodified: drivers/usb/gadget/at91_udc.h\n#\tmodified: drivers/usb/gadget/dummy_hcd.c\n#\tmodified: drivers/usb/gadget/file_storage.c\n#\tmodified: drivers/usb/gadget/gmidi.c\n#\tmodified: drivers/usb/gadget/goku_udc.c\n#\tmodified: drivers/usb/gadget/lh7a40x_udc.c\n#\tmodified: drivers/usb/gadget/net2280.c\n#\tmodified: drivers/usb/gadget/omap_udc.c\n#\tmodified: drivers/usb/gadget/pxa2xx_udc.c\n#\tmodified: drivers/usb/gadget/serial.c\n#\tmodified: drivers/usb/host/ohci-at91.c\n#\tmodified: drivers/usb/host/ohci-au1xxx.c\n#\tmodified: drivers/usb/host/ohci-dbg.c\n#\tmodified: drivers/usb/host/ohci-ep93xx.c\n#\tmodified: drivers/usb/host/ohci-hcd.c\n#\tmodified: drivers/usb/host/ohci-hub.c\n#\tmodified: drivers/usb/host/ohci-lh7a404.c\n#\tmodified: drivers/usb/host/ohci-mem.c\n#\tmodified: drivers/usb/host/ohci-omap.c\n#\tmodified: drivers/usb/host/ohci-pci.c\n#\tmodified: drivers/usb/host/ohci-pnx4008.c\n#\tnew file: drivers/usb/host/ohci-pnx8550.c\n#\tmodified: drivers/usb/host/ohci-ppc-soc.c\n#\tmodified: drivers/usb/host/ohci-pxa27x.c\n#\tmodified: drivers/usb/host/ohci-q.c\n#\tmodified: drivers/usb/host/ohci-s3c2410.c\n#\tmodified: drivers/usb/host/ohci-sa1111.c\n#\tmodified: drivers/usb/host/ohci.h\n#\tmodified: drivers/usb/host/u132-hcd.c\n#\tmodified: drivers/usb/host/uhci-hcd.c\n#\tmodified: drivers/usb/host/uhci-hub.c\n#\tmodified: drivers/usb/input/wacom_sys.c\n#\tmodified: drivers/usb/input/wacom_wac.c\n#\tmodified: drivers/usb/misc/auerswald.c\n#\tmodified: drivers/usb/misc/ftdi-elan.c\n#\tmodified: drivers/usb/misc/phidgetservo.c\n#\tmodified: drivers/usb/misc/trancevibrator.c\n#\tmodified: drivers/usb/net/gl620a.c\n#\tmodified: drivers/usb/net/rtl8150.c\n#\tmodified: drivers/usb/serial/airprime.c\n#\tmodified: drivers/usb/serial/cp2101.c\n#\tmodified: drivers/usb/serial/cypress_m8.c\n#\tmodified: drivers/usb/serial/ftdi_sio.c\n#\tmodified: drivers/usb/serial/ftdi_sio.h\n#\tmodified: drivers/usb/serial/funsoft.c\n#\tmodified: drivers/usb/serial/kl5kusb105.c\n#\tmodified: drivers/usb/serial/mos7840.c\n#\tmodified: drivers/usb/serial/option.c\n#\tmodified: drivers/usb/storage/unusual_devs.h\n#\tmodified: drivers/video/pxafb.c\n#\tmodified: drivers/video/sa1100fb.c\n#\tmodified: fs/dlm/lowcomms-tcp.c\n#\tmodified: fs/gfs2/Kconfig\n#\tmodified: fs/pipe.c\n#\tmodified: include/asm-arm/arch-iop13xx/iq81340.h\n#\tmodified: include/asm-arm/arch-ixp23xx/memory.h\n#\tmodified: include/asm-arm/arch-s3c2410/anubis-cpld.h\n#\tmodified: include/asm-arm/arch-s3c2410/anubis-irq.h\n#\tmodified: include/asm-arm/arch-s3c2410/anubis-map.h\n#\tmodified: include/asm-arm/arch-s3c2410/audio.h\n#\tmodified: include/asm-arm/arch-s3c2410/bast-cpld.h\n#\tmodified: include/asm-arm/arch-s3c2410/bast-irq.h\n#\tmodified: include/asm-arm/arch-s3c2410/bast-map.h\n#\tmodified: include/asm-arm/arch-s3c2410/bast-pmu.h\n#\tmodified: include/asm-arm/arch-s3c2410/h1940-latch.h\n#\tmodified: include/asm-arm/arch-s3c2410/hardware.h\n#\tmodified: include/asm-arm/arch-s3c2410/iic.h\n#\tmodified: include/asm-arm/arch-s3c2410/leds-gpio.h\n#\tmodified: include/asm-arm/arch-s3c2410/map.h\n#\tmodified: include/asm-arm/arch-s3c2410/nand.h\n#\tmodified: include/asm-arm/arch-s3c2410/osiris-cpld.h\n#\tmodified: include/asm-arm/arch-s3c2410/regs-serial.h\n#\tmodified: include/asm-arm/arch-s3c2410/system.h\n#\tmodified: include/asm-arm/arch-s3c2410/timex.h\n#\tmodified: include/asm-arm/arch-s3c2410/uncompress.h\n#\tmodified: include/asm-arm/arch-s3c2410/usb-control.h\n#\tmodified: include/asm-arm/arch-s3c2410/vr1000-cpld.h\n#\tmodified: include/asm-arm/arch-s3c2410/vr1000-irq.h\n#\tmodified: include/asm-arm/arch-s3c2410/vr1000-map.h\n#\tmodified: include/asm-arm/elf.h\n#\tmodified: include/asm-arm/unistd.h\n#\tmodified: include/asm-generic/vmlinux.lds.h\n#\tmodified: include/asm-powerpc/spu.h\n#\tmodified: include/linux/Kbuild\n#\tmodified: include/linux/blkdev.h\n#\tmodified: include/linux/device.h\n#\tmodified: include/linux/elevator.h\n#\tmodified: include/linux/ioport.h\n#\tmodified: include/linux/kobject.h\n#\tmodified: include/linux/pci.h\n#\tmodified: include/linux/pci_ids.h\n#\tmodified: include/linux/pci_regs.h\n#\tmodified: include/sound/pcm_oss.h\n#\tmodified: include/sound/version.h\n#\tmodified: include/sound/ymfpci.h\n#\tmodified: init/main.c\n#\tmodified: kernel/irq/chip.c\n#\tmodified: kernel/sched.c\n#\tmodified: kernel/workqueue.c\n#\tmodified: lib/kobject_uevent.c\n#\tmodified: lib/kref.c\n#\tmodified: sound/aoa/codecs/snd-aoa-codec-onyx.h\n#\tmodified: sound/aoa/codecs/snd-aoa-codec-tas.c\n#\tmodified: sound/core/control.c\n#\tmodified: sound/core/oss/pcm_oss.c\n#\tmodified: sound/core/pcm.c\n#\tmodified: sound/core/pcm_lib.c\n#\tmodified: sound/core/rawmidi.c\n#\tmodified: sound/core/seq/seq_memory.c\n#\tmodified: sound/core/sgbuf.c\n#\tmodified: sound/isa/gus/gus_mem.c\n#\tmodified: sound/isa/sb/sb_common.c\n#\tmodified: sound/isa/wavefront/wavefront_synth.c\n#\tmodified: sound/pci/ac97/ac97_codec.c\n#\tmodified: sound/pci/ac97/ac97_patch.c\n#\tmodified: sound/pci/ad1889.c\n#\tmodified: sound/pci/ali5451/ali5451.c\n#\tmodified: sound/pci/als300.c\n#\tmodified: sound/pci/atiixp.c\n#\tmodified: sound/pci/atiixp_modem.c\n#\tmodified: sound/pci/au88x0/au88x0.c\n#\tmodified: sound/pci/azt3328.c\n#\tmodified: sound/pci/bt87x.c\n#\tmodified: sound/pci/ca0106/ca0106.h\n#\tmodified: sound/pci/ca0106/ca0106_main.c\n#\tmodified: sound/pci/cmipci.c\n#\tmodified: sound/pci/cs4281.c\n#\tmodified: sound/pci/cs46xx/cs46xx_lib.c\n#\tmodified: sound/pci/cs5535audio/cs5535audio.c\n#\tmodified: sound/pci/echoaudio/echoaudio.c\n#\tmodified: sound/pci/emu10k1/emu10k1_main.c\n#\tmodified: sound/pci/emu10k1/emu10k1x.c\n#\tmodified: sound/pci/ens1370.c\n#\tmodified: sound/pci/es1938.c\n#\tmodified: sound/pci/es1968.c\n#\tmodified: sound/pci/fm801.c\n#\tmodified: sound/pci/hda/hda_codec.c\n#\tmodified: sound/pci/hda/hda_intel.c\n#\tmodified: sound/pci/hda/hda_proc.c\n#\tmodified: sound/pci/hda/patch_analog.c\n#\tmodified: sound/pci/hda/patch_realtek.c\n#\tmodified: sound/pci/hda/patch_si3054.c\n#\tmodified: sound/pci/ice1712/ice1712.c\n#\tmodified: sound/pci/ice1712/ice1724.c\n#\tmodified: sound/pci/intel8x0.c\n#\tmodified: sound/pci/intel8x0m.c\n#\tmodified: sound/pci/korg1212/korg1212.c\n#\tmodified: sound/pci/maestro3.c\n#\tmodified: sound/pci/mixart/mixart.c\n#\tmodified: sound/pci/nm256/nm256.c\n#\tmodified: sound/pci/pcxhr/pcxhr.c\n#\tmodified: sound/pci/riptide/riptide.c\n#\tmodified: sound/pci/rme32.c\n#\tmodified: sound/pci/rme96.c\n#\tmodified: sound/pci/rme9652/hdsp.c\n#\tmodified: sound/pci/rme9652/hdspm.c\n#\tmodified: sound/pci/rme9652/rme9652.c\n#\tmodified: sound/pci/sonicvibes.c\n#\tmodified: sound/pci/trident/trident_main.c\n#\tmodified: sound/pci/via82xx.c\n#\tmodified: sound/pci/via82xx_modem.c\n#\tmodified: sound/pci/vx222/vx222.c\n#\tmodified: sound/pci/ymfpci/ymfpci.c\n#\tmodified: sound/pci/ymfpci/ymfpci_main.c\n#\tmodified: sound/usb/usbaudio.c\n#\n#\n# Changed but not updated:\n#   (use git-update-index to mark for commit)\n#\n#\tunmerged: arch/arm/mach-ep93xx/core.c\n#\tmodified: arch/arm/mach-ep93xx/ep93xx_devices.c\n#\tmodified: drivers/net/arm/ep93xx_eth.c\n#\tmodified: drivers/video/ep93xxfb.c\n#\tunmerged: include/asm-arm/system.h\n#\tmodified: include/asm-arm/system.h\n#\n#\n# Untracked files:\n#   (use \"git add\" to add to commit)\n#\n#\tbuild.sh\n#\tdogit.sh\n#\tinclude/asm-arm/arch-ep93xx/not-in-used/\n#\tlog-status\n\n\nB. git-diff output\n==========\n\ndiff --cc include/asm-arm/system.h\nindex 04d6d2c,aa223fc..0000000\n--- a/include/asm-arm/system.h\n+++ b/include/asm-arm/system.h\n@@@ -170,31 -178,6 +178,34 @@@\n  \t  : : \"r\" (val) : \"cc\");\n  }\n\n++<<<<<<< HEAD/include/asm-arm/system.h\n +extern unsigned long cr_no_alignment;\t/* defined in entry-armv.S */\n +extern unsigned long cr_alignment;\t/* defined in entry-armv.S */\n +\n +#include <linux/irqflags.h>\n +\n +#ifndef CONFIG_SMP\n +static inline void adjust_cr(unsigned long mask, unsigned long set)\n +{\n +\tunsigned long flags;\n +\n +\tmask &= ~CR_A;\n +\n +\tset &= mask;\n +\n +\traw_local_irq_save(flags);\n +\n +\tcr_no_alignment = (cr_no_alignment & ~mask) | set;\n +\tcr_alignment = (cr_alignment & ~mask) | set;\n +\n +\tset_cr((get_cr() & ~mask) | set);\n +\n +\traw_local_irq_restore(flags);\n +}\n +#endif\n +\n++=======\n++>>>>>>> 9bfb18392ef586467277fa25d8f3a7a93611f6df/include/asm-arm/system.h\n  #define UDBG_UNDEFINED\t(1 << 0)\n  #define UDBG_SYSCALL\t(1 << 1)\n  #define UDBG_BADABORT\t(1 << 2)\n\nC. And if I do git-pull again\n=================\n\nTrying really trivial in-index merge...\narch/arm/mach-ep93xx/core.c: needs merge\narch/arm/mach-ep93xx/ep93xx_devices.c: needs update\ndrivers/net/arm/ep93xx_eth.c: needs update\ndrivers/video/ep93xxfb.c: needs update\ninclude/asm-arm/system.h: needs merge\nNope.\nMerging HEAD with 3e67c0987d7567ad666641164a153dca9a43b11d\nMerging:\n87d627b097b52c47610037bfb890940752fbf4c8 added .orig to gitignore\n3e67c0987d7567ad666641164a153dca9a43b11d [PATCH] truncate: clear page\ndirtiness before running try_to_free_buffers()\nfound 1 common ancestor(s):\nf238085415c56618e042252894f2fcc971add645 Merge branch 'for-linus' of\ngit://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid\n\n\nD. diff output between file stamp 12-dec and 21-dec\n=====================================\n\n--- linux-2.6/include/asm-arm/system.h\t2006-12-19 11:31:18.000000000 +0100\n+++ linux-2.6-ep93xx/include/asm-arm/system.h\t2006-12-21\n15:37:18.000000000 +0100\n@@ -73,6 +73,7 @@\n #ifndef __ASSEMBLY__\n\n #include <linux/linkage.h>\n+#include <linux/irqflags.h>\n\n struct thread_info;\n struct task_struct;\n@@ -139,6 +140,9 @@\n #define\tcpu_is_xscale()\t1\n #endif\n\n+extern unsigned long cr_no_alignment;\t/* defined in entry-armv.S */\n+extern unsigned long cr_alignment;\t/* defined in entry-armv.S */\n+\n static inline unsigned int get_cr(void)\n {\n \tunsigned int val;\n@@ -152,6 +156,10 @@\n \t  : : \"r\" (val) : \"cc\");\n }\n\n+#ifndef CONFIG_SMP\n+extern void adjust_cr(unsigned long mask, unsigned long set);\n+#endif\n+\n #define CPACC_FULL(n)\t\t(3 << (n * 2))\n #define CPACC_SVC(n)\t\t(1 << (n * 2))\n #define CPACC_DISABLE(n)\t(0 << (n * 2))\n@@ -170,29 +178,34 @@\n \t  : : \"r\" (val) : \"cc\");\n }\n\n+<<<<<<< HEAD/include/asm-arm/system.h\n extern unsigned long cr_no_alignment;\t/* defined in entry-armv.S */\n extern unsigned long cr_alignment;\t/* defined in entry-armv.S */\n\n+#include <linux/irqflags.h>\n+\n #ifndef CONFIG_SMP\n static inline void adjust_cr(unsigned long mask, unsigned long set)\n {\n-\tunsigned long flags, cr;\n+\tunsigned long flags;\n\n \tmask &= ~CR_A;\n\n \tset &= mask;\n\n-\tlocal_irq_save(flags);\n+\traw_local_irq_save(flags);\n\n \tcr_no_alignment = (cr_no_alignment & ~mask) | set;\n \tcr_alignment = (cr_alignment & ~mask) | set;\n\n \tset_cr((get_cr() & ~mask) | set);\n\n-\tlocal_irq_restore(flags);\n+\traw_local_irq_restore(flags);\n }\n #endif\n\n+=======\n+>>>>>>> 9bfb18392ef586467277fa25d8f3a7a93611f6df/include/asm-arm/system.h\n #define UDBG_UNDEFINED\t(1 << 0)\n #define UDBG_SYSCALL\t(1 << 1)\n #define UDBG_BADABORT\t(1 << 2)\n@@ -248,8 +261,6 @@\n {\n }\n\n-#include <linux/irqflags.h>\n-\n #ifdef CONFIG_SMP\n\n #define smp_mb()\t\tmb()\n"},{"id":"30095","messageId":"7vwt4jy84b.fsf@assigned-by-dhcp.cox.net","threadId":"6077","inReplyTo":"6bb9c1030612220326w6ce88d0ar1ca5ca49b306c71e@mail.gmail.com","subject":"Re: newbie question - git-pull and local branch merge","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-22T20:43:16Z","receivedAt":"2006-12-22T20:43:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Pelle Svensson\" <pelle2004@gmail.com> writes:\n\n> Problem is that git-pull failed to merge closed to what you describe in case 2\n> and I really like to know hat has been done between the 2 last versions\n> on the Linus side.\n\nLet me have a set of illustrations (I cannot think without one\nX-<).  You forked off of Linus's tip some time ago (time flows\nfrom left to right):\n\n      x---x---x---x Pelle\n     /\n ---o Linus\n\nin the meantime Linus's tip progressed:\n\n      x---x---x---x   Pelle\n     /\n ---o---*---*---*---* Linus\n\nand you are trying to create a merge 'M' by pulling from him:\n\n\n      x---x---x---x...M    Pelle\n     /               / \n ---o---*---*---*---*      Linus\n\nThe 'pull' conflicted so you do not have 'M' commit yet.\n\nIn such a situation, a command that helps to view what happened\nto the files that got conflicted is:\n\n\t$ git log -p --merge\n\nBy default it uses the \"unmreged\" files (in your case,\narch/arm/mach-ep93xx/core.c and include/asm-arm/system.h).  You\ncan limit the output by giving specific paths:\n\n\t$ git log -p --merge include/asm-arm/system.h\n\nThis would show changes from both sides (i.e. commits marked\nwith 'x' and '*').\n\n> The problematic file is include/asm-arm/system.h\n>\n> I attached some output below. Last (D) is a file diff between the time when\n> I first pulled the Linus tree and a copy of that which I'm now working in.\n> I think the resolve/edit part is easy because Linus tree seem to added\n> an extern declaration of 'adjust_cr' closed to line 152 and the other\n> conflict code (++<<<...) should be removed.\n\n> But is it not possible to show changes/diff version by version of\n> what has been done in the Linus tree?\n\nI think \"log --merge\" is what you want, but if you do not want\nto see your own changes, you can:\n\n\t$ git log -p ..MERGE_HEAD -- include/asm-arm/system.h\n\nThe notation \"..MERGE_HEAD\" in the above is a short-hand for\n\"HEAD..MERGE_HEAD\", and \"A..B\" means \"show commits reachable\nfrom B but I am not interested in the ones reachable from A\", so\nit shows what are in MERGE_HEAD but not in your HEAD, which I\nthink is exactly what you want.  And paths on the command line\nlimits the commits considered by the command to only those that\ntouch the specified paths.\n\n> A. git-status output\n> B. git-diff output\n> C. And if I do git-pull again\n> D. diff output between file stamp 12-dec and 21-dec\n>\n> A. git-status output\n> ============\n>\n> # On branch refs/heads/ep93xx-pmp\n> #\n> # Updated but not checked in:\n> #   (will commit)\n> #\n> #\tmodified: Documentation/block/biodoc.txt\n> #     ...\n> #\tmodified: sound/usb/usbaudio.c\n\nThese are list of paths that got changed on Linus's side and\neither you did not change at all, or had changes that were\ncleanly merged.\n\n> #\n> #\n> # Changed but not updated:\n> #   (use git-update-index to mark for commit)\n> #\n> #\tunmerged: arch/arm/mach-ep93xx/core.c\n> #\tmodified: arch/arm/mach-ep93xx/ep93xx_devices.c\n> #\tmodified: drivers/net/arm/ep93xx_eth.c\n> #\tmodified: drivers/video/ep93xxfb.c\n> #\tunmerged: include/asm-arm/system.h\n> #\tmodified: include/asm-arm/system.h\n\nI thought you had local modification to two paths, but this\nshows four 'modified:' files.  Please make sure these four\n'modified' files were not modified on the Linus's side\n(e.g. \"git log -p ..MERGE_HEAD -- drivers/video/ep93xxfb.c\" as\nshown above), and only contains your own changes.\n\nTwo 'unmerged' paths are what you changed and committed in some\nof the 'x' commits in the above picture and also had\nmodifications on Linus's side.\n\n> B. git-diff output\n> ==========\n>\n> diff --cc include/asm-arm/system.h\n> index 04d6d2c,aa223fc..0000000\n> --- a/include/asm-arm/system.h\n> +++ b/include/asm-arm/system.h\n> @@@ -170,31 -178,6 +178,34 @@@\n>  \t  : : \"r\" (val) : \"cc\");\n>  }\n>\n> ++<<<<<<< HEAD/include/asm-arm/system.h\n> +extern unsigned long cr_no_alignment;\t/* defined in entry-armv.S */\n> +extern unsigned long cr_alignment;\t/* defined in entry-armv.S */\n> ...\n\nYou added this section and Linus's side did not have it.\n\n> ...\n> +\traw_local_irq_restore(flags);\n> +}\n> +#endif\n> +\n> ++=======\n> ++>>>>>>> 9bfb18392ef586467277fa25d8f3a7a93611f6df/include/asm-arm/system.h\n>  #define UDBG_UNDEFINED\t(1 << 0)\n>  #define UDBG_SYSCALL\t(1 << 1)\n>  #define UDBG_BADABORT\t(1 << 2)\n\nSo as you said, it seems appropriate to just keep your changes.\nby removing the conflict markers.\n\n> C. And if I do git-pull again\n> =================\n>\n> Trying really trivial in-index merge...\n> arch/arm/mach-ep93xx/core.c: needs merge\n> arch/arm/mach-ep93xx/ep93xx_devices.c: needs update\n> drivers/net/arm/ep93xx_eth.c: needs update\n> drivers/video/ep93xxfb.c: needs update\n> include/asm-arm/system.h: needs merge\n> Nope.\n> Merging HEAD with 3e67c0987d7567ad666641164a153dca9a43b11d\n> Merging:\n> 87d627b097b52c47610037bfb890940752fbf4c8 added .orig to gitignore\n> 3e67c0987d7567ad666641164a153dca9a43b11d [PATCH] truncate: clear page\n> dirtiness before running try_to_free_buffers()\n> found 1 common ancestor(s):\n> f238085415c56618e042252894f2fcc971add645 Merge branch 'for-linus' of\n> git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid\n\nWas this the end of the output?  I hope you hit this message:\n\n\tdie(\"Entry '%s' not uptodate. Cannot merge.\", ce->name);\n\nand the second pull did not make any change.  At least that is\nhow it ought to work.  You might have spotted a bug that was\nuncovered only because no git old timers would even imagine\nrunning 'pull' again after getting conflicts from the first\nattempt, but I suspect that the above quoted output is not\nshowing the end of the output.\n"}]}