git format-patch with several ranges
How can I generate a single numbered list of patches from several separate ranges?
Let's say I need patches from range A and range B in the git tree.
For the sake of simplicity, let's say each range has 10 patches.
The usual way to generate those patches would be two separate git commands:
git format-patch range_A_from..range_A_to
git format-patch range_B_from..range_B_to
The result of this would be two separate lists of patches, each numbered from 0001 to 0010.
What I want is a single list of patches numbered from 0001 to 0020, so that it would be clear who comes first.
Any way doing this with git w/o the need to rename the patch files?
git
|
show 4 more comments
How can I generate a single numbered list of patches from several separate ranges?
Let's say I need patches from range A and range B in the git tree.
For the sake of simplicity, let's say each range has 10 patches.
The usual way to generate those patches would be two separate git commands:
git format-patch range_A_from..range_A_to
git format-patch range_B_from..range_B_to
The result of this would be two separate lists of patches, each numbered from 0001 to 0010.
What I want is a single list of patches numbered from 0001 to 0020, so that it would be clear who comes first.
Any way doing this with git w/o the need to rename the patch files?
git
2
See the--start-number
option. Alternatively, you can generate them all to stdout instead of putting them in separate files.
– torek
Jan 1 at 12:05
You can create a temporary branch containing exactly the required commits.git rebase --interactive
is a good UI for that. Bonus: You will see conflicts which are caused by the "missing" commits.
– A.H.
Jan 1 at 12:34
@torek that could work :) Please post as an answer.
– kliteyn
Jan 1 at 12:43
It's annoying to use because format-patch doesn't tell you how many it made. (It also, as @A.H. noted, runs the risk of producing patches that won't apply.)
– torek
Jan 1 at 12:44
Sure, but I'm not interested in resolving patch conflicts here. I just want to have a list of the patches. Interactive rebase is no good here as well - it requires me actually fix all the conflicts and apply the patches on the current branch. What I'm looking for is preparing the list of patches and applying them on a different tree/branch/whatever (and there I will need to resolve the conflicts).
– kliteyn
Jan 1 at 12:49
|
show 4 more comments
How can I generate a single numbered list of patches from several separate ranges?
Let's say I need patches from range A and range B in the git tree.
For the sake of simplicity, let's say each range has 10 patches.
The usual way to generate those patches would be two separate git commands:
git format-patch range_A_from..range_A_to
git format-patch range_B_from..range_B_to
The result of this would be two separate lists of patches, each numbered from 0001 to 0010.
What I want is a single list of patches numbered from 0001 to 0020, so that it would be clear who comes first.
Any way doing this with git w/o the need to rename the patch files?
git
How can I generate a single numbered list of patches from several separate ranges?
Let's say I need patches from range A and range B in the git tree.
For the sake of simplicity, let's say each range has 10 patches.
The usual way to generate those patches would be two separate git commands:
git format-patch range_A_from..range_A_to
git format-patch range_B_from..range_B_to
The result of this would be two separate lists of patches, each numbered from 0001 to 0010.
What I want is a single list of patches numbered from 0001 to 0020, so that it would be clear who comes first.
Any way doing this with git w/o the need to rename the patch files?
git
git
asked Jan 1 at 10:26


kliteynkliteyn
1,395620
1,395620
2
See the--start-number
option. Alternatively, you can generate them all to stdout instead of putting them in separate files.
– torek
Jan 1 at 12:05
You can create a temporary branch containing exactly the required commits.git rebase --interactive
is a good UI for that. Bonus: You will see conflicts which are caused by the "missing" commits.
– A.H.
Jan 1 at 12:34
@torek that could work :) Please post as an answer.
– kliteyn
Jan 1 at 12:43
It's annoying to use because format-patch doesn't tell you how many it made. (It also, as @A.H. noted, runs the risk of producing patches that won't apply.)
– torek
Jan 1 at 12:44
Sure, but I'm not interested in resolving patch conflicts here. I just want to have a list of the patches. Interactive rebase is no good here as well - it requires me actually fix all the conflicts and apply the patches on the current branch. What I'm looking for is preparing the list of patches and applying them on a different tree/branch/whatever (and there I will need to resolve the conflicts).
– kliteyn
Jan 1 at 12:49
|
show 4 more comments
2
See the--start-number
option. Alternatively, you can generate them all to stdout instead of putting them in separate files.
– torek
Jan 1 at 12:05
You can create a temporary branch containing exactly the required commits.git rebase --interactive
is a good UI for that. Bonus: You will see conflicts which are caused by the "missing" commits.
– A.H.
Jan 1 at 12:34
@torek that could work :) Please post as an answer.
– kliteyn
Jan 1 at 12:43
It's annoying to use because format-patch doesn't tell you how many it made. (It also, as @A.H. noted, runs the risk of producing patches that won't apply.)
– torek
Jan 1 at 12:44
Sure, but I'm not interested in resolving patch conflicts here. I just want to have a list of the patches. Interactive rebase is no good here as well - it requires me actually fix all the conflicts and apply the patches on the current branch. What I'm looking for is preparing the list of patches and applying them on a different tree/branch/whatever (and there I will need to resolve the conflicts).
– kliteyn
Jan 1 at 12:49
2
2
See the
--start-number
option. Alternatively, you can generate them all to stdout instead of putting them in separate files.– torek
Jan 1 at 12:05
See the
--start-number
option. Alternatively, you can generate them all to stdout instead of putting them in separate files.– torek
Jan 1 at 12:05
You can create a temporary branch containing exactly the required commits.
git rebase --interactive
is a good UI for that. Bonus: You will see conflicts which are caused by the "missing" commits.– A.H.
Jan 1 at 12:34
You can create a temporary branch containing exactly the required commits.
git rebase --interactive
is a good UI for that. Bonus: You will see conflicts which are caused by the "missing" commits.– A.H.
Jan 1 at 12:34
@torek that could work :) Please post as an answer.
– kliteyn
Jan 1 at 12:43
@torek that could work :) Please post as an answer.
– kliteyn
Jan 1 at 12:43
It's annoying to use because format-patch doesn't tell you how many it made. (It also, as @A.H. noted, runs the risk of producing patches that won't apply.)
– torek
Jan 1 at 12:44
It's annoying to use because format-patch doesn't tell you how many it made. (It also, as @A.H. noted, runs the risk of producing patches that won't apply.)
– torek
Jan 1 at 12:44
Sure, but I'm not interested in resolving patch conflicts here. I just want to have a list of the patches. Interactive rebase is no good here as well - it requires me actually fix all the conflicts and apply the patches on the current branch. What I'm looking for is preparing the list of patches and applying them on a different tree/branch/whatever (and there I will need to resolve the conflicts).
– kliteyn
Jan 1 at 12:49
Sure, but I'm not interested in resolving patch conflicts here. I just want to have a list of the patches. Interactive rebase is no good here as well - it requires me actually fix all the conflicts and apply the patches on the current branch. What I'm looking for is preparing the list of patches and applying them on a different tree/branch/whatever (and there I will need to resolve the conflicts).
– kliteyn
Jan 1 at 12:49
|
show 4 more comments
1 Answer
1
active
oldest
votes
As answered by @torek in the comment: see the --start-number
option.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994713%2fgit-format-patch-with-several-ranges%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As answered by @torek in the comment: see the --start-number
option.
add a comment |
As answered by @torek in the comment: see the --start-number
option.
add a comment |
As answered by @torek in the comment: see the --start-number
option.
As answered by @torek in the comment: see the --start-number
option.
answered Jan 25 at 21:39


kliteynkliteyn
1,395620
1,395620
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994713%2fgit-format-patch-with-several-ranges%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
See the
--start-number
option. Alternatively, you can generate them all to stdout instead of putting them in separate files.– torek
Jan 1 at 12:05
You can create a temporary branch containing exactly the required commits.
git rebase --interactive
is a good UI for that. Bonus: You will see conflicts which are caused by the "missing" commits.– A.H.
Jan 1 at 12:34
@torek that could work :) Please post as an answer.
– kliteyn
Jan 1 at 12:43
It's annoying to use because format-patch doesn't tell you how many it made. (It also, as @A.H. noted, runs the risk of producing patches that won't apply.)
– torek
Jan 1 at 12:44
Sure, but I'm not interested in resolving patch conflicts here. I just want to have a list of the patches. Interactive rebase is no good here as well - it requires me actually fix all the conflicts and apply the patches on the current branch. What I'm looking for is preparing the list of patches and applying them on a different tree/branch/whatever (and there I will need to resolve the conflicts).
– kliteyn
Jan 1 at 12:49