Re: [PATCH 2/2] rebase: add --show-patch
- From
- Phillip Wood <phillip.wood@talktalk.net>
- Date
- Jan 30, 2018, 11:15 UTC
- Message-ID
- <a504c74a-49d4-4921-e763-34f5e7676868@talktalk.net>
- In-Reply-To
- <CACsJy8BsJjuxD8hhZ9P2KgTxraRvCJgYt83onBaD_gXA0ZP9DA@mail.gmail.com>
On 26/01/18 11:22, Duy Nguyen wrote:
Show 28 quoted lines
> On Fri, Jan 26, 2018 at 6:12 PM, Phillip Wood <phillip.wood@talktalk.net> wrote:
>>> diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
>>> index 06a4723d4d..5c513a9736 100644
>>> --- a/git-rebase--merge.sh
>>> +++ b/git-rebase--merge.sh
>>> @@ -137,6 +137,10 @@ skip)
>>> finish_rb_merge
>>> return
>>> ;;
>>> +show-patch)
>>> + cmt="$(cat "$state_dir/current")"
>>> + exec git format-patch --subject-prefix= --stdout "${cmt}^!"
>>> + ;;
>>> esac
>>
>> Here and in the git-rebase--interactive you have access to the SHA of
>> the failed pick so you could run git log --patch and git colored output
>
> Yes. My first revision I actually did "git diff" here. The only
> problem is inconsistency because we can't color "git am --show-patch"
> the same way, the patch source is in text format, not in the repo. But
> if people are ok with that I sure would switch to "git show".
>
>> and it would use the pager in the same way as 'git am --show-patch' does
>
> format-patch does set up pager. If it does not I would be very
> annoyed. I added this for convenience after all.
> Ah, I didn't realize that (now I come to think of it I've only ever used --stdout to redirect the output). As my perceived lack of pager was the main reason I suggested using log I'd ignore me.
I think the suggestion of having a ref for 'rebase -i' and 'rebase -m' could be good as it'd be more flexible though I'm not sure what you'd do about plain old rebase.
Best Wishes
Phillip