2 | | > Replying to [comment:16 walty8@…]: |
3 | | > > One quick question, if I squash the changes first, would it affect the code review comments on github? |
4 | | > |
5 | | > Yes, it will. That's why you should never rebase a branch that you've made public. Instead, you create a new branch based on your branch and rebase your new branch, leaving your old branch frozen in time forever. Usually we just append a `.1`, `.2`, ... as we create new branches that need to be rebased. For example, see #11901 in which I'm currently working with `.15`, but have not yet published (log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.14 in comment:37:ticket:11901 is the latest published). |
6 | | > |
7 | | > {{{#!sh |
8 | | > $ git checkout -b t12171 1.0-stable-t12171 |
9 | | > $ git rebase -i |
10 | | > }}} |
11 | | > |
12 | | > For your case, since we even want to go one step further and have your changes based on trunk rather than 1.0-stable, we can do the following; |
13 | | > {{{#!sh |
14 | | > $ git log --oneline -5 1.0-stable-t12171 |
15 | | > 075b5a0 remove extra line due to false merge process of previous |
16 | | > e49f1cf moved macro to trac/ticket/query.py, added unit tests, and restored req.args after macro finished |
17 | | > 24da572 uploaded missing file, and fixed code review comments by Jun Omae |
18 | | > 38f1c97 cherry pick commits de62ac711e514f32bef89772106bdc8996cf6d7a and 85081cba5cb487f87bff23c9b4ebec33fbdba510 |
19 | | > a516b71 1.0.10dev: Workaround case-sensitivity defect in setuptools |
20 | | > # Note that your changes are based on the tip of 1.0-stable (a516b71) |
21 | | > $ git checkout trunk |
22 | | > # You should have added the mirror as described in https://trac.edgewall.org/wiki/TracTeam/Repositories#git |
23 | | > # If you haven't added the mirror yet, run these next two steps. If you have, skip them. |
24 | | > $ git remote add mirror http://svn.edgewall.org/git/trac/mirror |
25 | | > $ git fetch mirror |
26 | | > # Pull latest changes from the mirror to trunk. |
27 | | > $ git pull mirror trunk |
28 | | > $ git log --oneline -1 |
29 | | > cf506ee 1.2dev: Unselect all other search filters when modifier key selected #<-- this is the latest commit on trunk |
30 | | > $ git checkout -b t12171 |
31 | | > $ git cherry-pick 1.0-stable-t12171~4..1.0-stable-t12171 |
32 | | > error: could not apply 38f1c97... cherry pick commits de62ac711e514f32bef89772106bdc8996cf6d7a and 85081cba5cb487f87bff23c9b4ebec33fbdba510 |
33 | | > hint: after resolving the conflicts, mark the corrected paths |
34 | | > hint: with 'git add <paths>' or 'git rm <paths>' |
35 | | > hint: and commit the result with 'git commit' |
36 | | > $ # resolve conflict in trac/wiki/macros.py ... |
37 | | > $ git add trac/wiki/macros.py |
38 | | > $ git cherry-pick --continue |
39 | | > $ # repeat pattern until all conflicts resolved and all changes applied ... |
40 | | > $git status -sb |
41 | | > ## t12171 |
42 | | > $git log --oneline -5 |
43 | | > 5569691 remove extra line due to false merge process of previous |
44 | | > 226e380 moved macro to trac/ticket/query.py, added unit tests, and restored req.args after macro finished |
45 | | > 53bb63b uploaded missing file, and fixed code review comments by Jun Omae |
46 | | > adb427f cherry pick commits de62ac711e514f32bef89772106bdc8996cf6d7a and 85081cba5cb487f87bff23c9b4ebec33fbdba510 |
47 | | > cf506ee 1.2dev: Unselect all other search filters when modifier key selected |
48 | | > # Note that your four changesets are based on the tip of the trunk (cf506ee) |
49 | | > # Now we are finally ready to rebase |
50 | | > $ git rebase -i |
51 | | > }}} |
52 | | > |
53 | | > Actually, I wouldn't be surprised if there's a better way to do that. With Git there's always several ways to accomplish the same task. |
54 | | > |
55 | | > Future rebases will be much simpler. |
56 | | > |
57 | | > {{{#!sh |
58 | | > $ git checkout trunk |
59 | | > $ git pull mirror trunk |
60 | | > $ git checkout -b t12171.2 t12171 |
61 | | > $ git rebase trunk |
62 | | > $ git rebase -i # Squash, fixup, edit commit message, etc ... |
63 | | > }}} |
| 2 | > (snip) |