V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
kgdb00
V2EX  ›  git

为什么 git show 查看 merge tag 的 commit 时会有 diff 的输出?

  •  
  •   kgdb00 · 2022-05-11 11:46:30 +08:00 · 1419 次点击
    这是一个创建于 926 天前的主题,其中的信息可能已经有所发展或是发生改变。

    例如 linux 内核的这个 commit

    git show 38904911e86495d4690f8d805720b90e65426c71 的输出如下:

    commit 38904911e86495d4690f8d805720b90e65426c71
    Merge: 6f34f8c3d617 c15e0ae42c8e
    Author: Linus Torvalds <[email protected]>
    Date:   Sat Apr 2 12:09:02 2022 -0700
    
        Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
        
        Pull kvm fixes from Paolo Bonzini:
        
         - Only do MSR filtering for MSRs accessed by rdmsr/wrmsr
        
         - Documentation improvements
        
         - Prevent module exit until all VMs are freed
        
         - PMU Virtualization fixes
        
         - Fix for kvm_irq_delivery_to_apic_fast() NULL-pointer dereferences
        
         - Other miscellaneous bugfixes
        
        * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (42 commits)
          KVM: x86: fix sending PV IPI
          KVM: x86/mmu: do compare-and-exchange of gPTE via the user address
          KVM: x86: Remove redundant vm_entry_controls_clearbit() call
          KVM: x86: cleanup enter_rmode()
          KVM: x86: SVM: fix tsc scaling when the host doesn't support it
          kvm: x86: SVM: remove unused defines
          KVM: x86: SVM: move tsc ratio definitions to svm.h
          KVM: x86: SVM: fix avic spec based definitions again
          KVM: MIPS: remove reference to trap&emulate virtualization
          KVM: x86: document limitations of MSR filtering
          KVM: x86: Only do MSR filtering when access MSR by rdmsr/wrmsr
          KVM: x86/emulator: Emulate RDPID only if it is enabled in guest
          KVM: x86/pmu: Fix and isolate TSX-specific performance event logic
          KVM: x86: mmu: trace kvm_mmu_set_spte after the new SPTE was set
          KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs
          KVM: x86: Trace all APICv inhibit changes and capture overall status
          KVM: x86: Add wrappers for setting/clearing APICv inhibits
          KVM: x86: Make APICv inhibit reasons an enum and cleanup naming
          KVM: X86: Handle implicit supervisor access with SMAP
          KVM: X86: Rename variable smap to not_smap in permission_fault()
          ...
    
    diff --cc arch/x86/include/asm/kvm_host.h
    index 4138939532c6,93a2671a57cf..d23e80a56eb8
    --- a/arch/x86/include/asm/kvm_host.h
    +++ b/arch/x86/include/asm/kvm_host.h
    @@@ -512,9 -513,10 +514,10 @@@ struct kvm_pmu 
            u64 global_ctrl_mask;
            u64 global_ovf_ctrl_mask;
            u64 reserved_bits;
    +       u64 raw_event_mask;
            u8 version;
            struct kvm_pmc gp_counters[INTEL_PMC_MAX_GENERIC];
     -      struct kvm_pmc fixed_counters[INTEL_PMC_MAX_FIXED];
     +      struct kvm_pmc fixed_counters[KVM_PMC_MAX_FIXED];
            struct irq_work irq_work;
            DECLARE_BITMAP(reprogram_pmi, X86_PMC_IDX_MAX);
            DECLARE_BITMAP(all_valid_pmc_idx, X86_PMC_IDX_MAX);
    
    

    我认为这里不应该有 diff 的输出,而且这个 diff 的输出我完全看不出有什么意义。

    3 条回复    2022-05-14 09:42:37 +08:00
    wynemo
        1
    wynemo  
       2022-05-11 13:40:18 +08:00
    这个是不是处理 merge 冲突产生的
    Defined
        2
    Defined  
       2022-05-11 14:48:16 +08:00
    处理冲突时候的改动
    aleen42
        3
    aleen42  
       2022-05-14 09:42:37 +08:00 via Android
    沒規定說 merge commit 不能有任何變更
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2793 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 11:32 · PVG 19:32 · LAX 03:32 · JFK 06:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.