I have used subtree for pulling changes from QEMU releases into MARSS . Sometimes when we want to make change to QEMU and send patches upstream, then using 'git format-patch' doesn't work by default because the patch is created with 'marss' has top directory. As shown in the 'git diff' output below:
diff --git a/qemu/target-i386/cpu.h b/qemu/target-i386/cpu.h index 7f2103f..7047115 100644 --- a/qemu/target-i386/cpu.h +++ b/qemu/target-i386/cpu.h @@ -636,6 +636,7 @@ typedef struct CPUX86State { #ifdef MARSS_QEMU target_ulong cr[8]; /* NOTE: cr1 is unused */ uint8_t handle_interrupt; /* Simulater managed int enable flag */ + uint64_t simpoint_decr; #else target_ulong cr[5]; /* NOTE: cr1 is unused */ #endifAs highlighted lines 3 and 4 the diff starts with 'qemu' folder. If we want to submit this patch to qemu mainline then it wont work as it should not start with 'qemu'. To solve this issue git diff provides a command line flag --relative=[path]. Now with this flag we can tell the git to generate 'diff' with relative folder. For example,
$ git diff --relative=qemu/will show the diff as below:
diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 7f2103f..7047115 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -636,6 +636,7 @@ typedef struct CPUX86State { #ifdef MARSS_QEMU target_ulong cr[8]; /* NOTE: cr1 is unused */ uint8_t handle_interrupt; /* Simulater managed int enable flag */ + uint64_t simpoint_decr; #else target_ulong cr[5]; /* NOTE: cr1 is unused */ #endifSo use '--relative' to generate patches to submit upstream. Bonus Tip: You can also use '--relative' with 'git format-patch'.
No comments:
Post a Comment