libgit2 / libgit2/rugged

Rebase finishes incorrectly with rugged later than v0.25.0b2

Open
#691 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.3k
Forks
293
PR merge metrics
No merged PRs in 30d

Description

Rugged::Rebase#finish doesn't get back a current branch to the original.

What am I doing wrong?

How to reproduce

57b46eb (Today's HEAD): ❌

$ git clone https://github.com/libgit2/rugged.git
$ cd rugged
4 git submodule update --init
$ rake compile:rugged

$ git checkout -b test
Switched to a new branch 'test'

$ ruby -I lib test.rb
$ git status
HEAD detached at refs/heads/test  # <-- NG
...

2998346 ❌

$ git checkout 2998346
$ git submodule update; rake clean; rake compile:rugged
$ git branch -D test; git co -b test
Deleted branch test (was 57b46eb).
Switched to a new branch 'test'

$ ruby -I lib test.rb
$ git status
HEAD detached from refs/heads/test  # <-- NG
...

2139edd ⭕

$ git checkout 2139edd
$ git submodule update; rake clean; rake compile:rugged
$ git branch -D test; git co -b test
Deleted branch test (was 2998346).
Switched to a new branch 'test'

$ ruby -I lib test.rb
$ git status
HEAD detached test  # <-- OK
...

ruby code

# test.ruby

require 'rugged'

repo = Rugged::Repository.new('.')
r = Rugged::Rebase.new(repo, "refs/heads/test", "refs/heads/master")

r.finish({name: 'me', email: 'me@example.com'})

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Rugged::Rebase#finish entry point and run the supplied test.rb reproduction against the listed revisions. Compare the resulting branch state from git status with the expected attached test branch, then trace the rebase finish behavior until the current branch is restored correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, ruby
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.