# RFE: teach gitk to automatically mark .git/rebase-merge/stopped-sha

3 messages from 2020-05-04 to 2020-05-05. Participants: Mikko Rantalainen, Phillip Wood, Philip Oakley.
Thread: https://gitlist.dev/t/53388

## Mikko Rantalainen, 2020-05-04 08:26

Subject: RFE: teach gitk to automatically mark .git/rebase-merge/stopped-sha
Message-ID: <1dbc41e9-b2e5-0b77-26c4-c912c82f9069@peda.net>
URL: https://gitlist.dev/e/1dbc41e9-b2e5-0b77-26c4-c912c82f9069%40peda.net

```
While doing long rebases (I'm currently rebasing a feature branch with
166 patches) and rebase stopping in the middle of rebase, locating the
old patch in gitk is sometimes hard.

Could gitk automatically mark the original patch that failed to rebase
after I press F5?

The failing original commit SHA-1 can be found in file
.git/rebase-merge/stopped-sha but as far as I know, git does have
logical commit name similar to HEAD, ORIG_HEAD or anything else for this
case so there's no easy way to get already running gitk to mark this patch.

Of course, doing the same thing for failed cherry-picks would be nice,
too but in that case it's pretty clear where the source patch is.

As a workaround I currently have to do something like
  git tag -f FAILED_HEAD $(cat .git/rebase-merge/stopped-sha)
after seeing rebase failure. Then I can hit F5 in gitk to easily locate
the source commit.

PS. Is there a way to automatically run git tag -f FAILED_HEAD $(cat
.git/rebase-merge/stopped-sha) if rebase fails in the middle of branch?

-- 
Mikko

```

## Phillip Wood, 2020-05-05 19:42

Subject: Re: RFE: teach gitk to automatically mark .git/rebase-merge/stopped-sha
Message-ID: <79d0c40d-3bfb-2902-3538-1eb1a6cd68fe@gmail.com>
URL: https://gitlist.dev/e/79d0c40d-3bfb-2902-3538-1eb1a6cd68fe%40gmail.com
In-Reply-To: <1dbc41e9-b2e5-0b77-26c4-c912c82f9069@peda.net>

```
Hi Mikko

On 04/05/2020 09:26, Mikko Rantalainen wrote:
> While doing long rebases (I'm currently rebasing a feature branch with
> 166 patches) and rebase stopping in the middle of rebase, locating the
> old patch in gitk is sometimes hard.
> 
> Could gitk automatically mark the original patch that failed to rebase
> after I press F5?
> 
> The failing original commit SHA-1 can be found in file
> .git/rebase-merge/stopped-sha but as far as I know, git does have
> logical commit name similar to HEAD, ORIG_HEAD or anything else for this
> case so there's no easy way to get already running gitk to mark this patch.

Since git v2.17 rebase which should set REBASE_HEAD to point to the 
failing commit.

Best Wishes

Phillip

> Of course, doing the same thing for failed cherry-picks would be nice,
> too but in that case it's pretty clear where the source patch is.
> 
> As a workaround I currently have to do something like
>    git tag -f FAILED_HEAD $(cat .git/rebase-merge/stopped-sha)
> after seeing rebase failure. Then I can hit F5 in gitk to easily locate
> the source commit.
> 
> PS. Is there a way to automatically run git tag -f FAILED_HEAD $(cat
> .git/rebase-merge/stopped-sha) if rebase fails in the middle of branch?
> 

```

## Philip Oakley, 2020-05-05 20:42

Subject: Re: RFE: teach gitk to automatically mark .git/rebase-merge/stopped-sha
Message-ID: <18b66ddb-b490-883e-43e9-3c04f9d95448@iee.email>
URL: https://gitlist.dev/e/18b66ddb-b490-883e-43e9-3c04f9d95448%40iee.email
In-Reply-To: <79d0c40d-3bfb-2902-3538-1eb1a6cd68fe@gmail.com>

```
Hi Phillip,

On 05/05/2020 20:42, Phillip Wood wrote:
> Hi Mikko
>
> On 04/05/2020 09:26, Mikko Rantalainen wrote:
>> While doing long rebases (I'm currently rebasing a feature branch with
>> 166 patches) and rebase stopping in the middle of rebase, locating the
>> old patch in gitk is sometimes hard.
>>
>> Could gitk automatically mark the original patch that failed to rebase
>> after I press F5?
>>
>> The failing original commit SHA-1 can be found in file
>> .git/rebase-merge/stopped-sha but as far as I know, git does have
>> logical commit name similar to HEAD, ORIG_HEAD or anything else for this
>> case so there's no easy way to get already running gitk to mark this
>> patch.
>
> Since git v2.17 rebase which should set REBASE_HEAD to point to the
> failing commit.

Is that a proper Pseudo Ref or is it just a temporary feature during a
rebase?

I see it's only mentioned once in the Documentation in the Rebase man page.

(I see a lot of discussion on the reftable support, with the pseudo refs
being at least one sticking point.)

Philip
>
> Best Wishes
>
> Phillip
>
>> Of course, doing the same thing for failed cherry-picks would be nice,
>> too but in that case it's pretty clear where the source patch is.
>>
>> As a workaround I currently have to do something like
>>    git tag -f FAILED_HEAD $(cat .git/rebase-merge/stopped-sha)
>> after seeing rebase failure. Then I can hit F5 in gitk to easily locate
>> the source commit.
>>
>> PS. Is there a way to automatically run git tag -f FAILED_HEAD $(cat
>> .git/rebase-merge/stopped-sha) if rebase fails in the middle of branch?
>>


```
