Project

General

Profile

How to create patch series on Mercurial and Git » History » Version 2

Toshi MARUYAMA, 2012-03-16 12:00
fix typo

1 1 Toshi MARUYAMA
h1. How to create patch series on Mercurial and Git
2
3
4
h2. Mercurial
5
6
You can use "hg export".
7
8
<pre>
9
$ hg log -l 2
10
changeset:   8260:d0d25df3c46b
11
branch:      git-fetch-20120316-original
12
tag:         tip
13
user:        test
14
date:        Fri Mar 16 11:25:26 2012 +0900
15
summary:     Process new git revisions all at once rather than per
16
17
changeset:   8259:30d69339f9a2
18
branch:      git-fetch-20120316-original
19
user:        test
20
date:        Fri Mar 16 11:25:10 2012 +0900
21
summary:     Pass revisions to git-log via stdin
22
</pre>
23
24
<pre>
25
$ hg export -r 8259:8260 > example.diff
26
</pre>
27
28
h2. Git
29
30 2 Toshi MARUYAMA
You can use "git format-patch".
31 1 Toshi MARUYAMA
32
<pre>
33
$ git log -n 2 | cat
34
commit 3137eff804b0fc35b03e5c9c3ff574617f8a5bc7
35
Author: test
36
Date:   Fri Mar 16 19:06:15 2012 +0900
37
38
    Process new git revisions all at once rather than per
39
    
40
41
commit 21a480dd6e08f3c3cce54e1d6ee4c05b0dd59daa
42
Author: test
43
Date:   Fri Mar 16 19:06:14 2012 +0900
44
45
    Pass revisions to git-log via stdin
46
    
47
</pre>
48
49
<pre>
50
$ git format-patch -k --stdout 21a480dd6e08f^..3137eff804b0fc35 > example-mbox-git.diff
51
</pre>