Skip to content

Add start_point option for checkout command#597

Merged
jcouball merged 1 commit into
ruby-git:masterfrom
insales:add_startpoint
Oct 5, 2022
Merged

Add start_point option for checkout command#597
jcouball merged 1 commit into
ruby-git:masterfrom
insales:add_startpoint

Conversation

@Vasfed

@Vasfed Vasfed commented Sep 27, 2022

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

This adds support for start-point git option when creating a new branch during checkout.
Fixes #249

@jcouball jcouball left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Vasfed! Thank you for this pull request.

I do have some requested changes in my review comments. In addition to those changes, can you also update the README.md to mention that this flag is supported?

Also, the build fails on Windows which you can see here:
https://github.com/ruby-git/ruby-git/actions/runs/3138166086/jobs/5154249814#step:4:41

===============================================================================
Error: test_checkout(TestLib):
  Git::GitExecuteError: git "--git-dir=D:/tmp/git_test1664642165171/working/.git" "--work-tree=D:/tmp/git_test1664642165171/working" "-c" "core.quotePath=true" "-c" "color.ui=false" checkout "-b" "test_checkout_b2" "master"  2>&1:error: Your local changes to the following files would be overwritten by checkout:
  	colon_numbers.txt
  	example.txt
  	scott/newfile
  	scott/text.txt
  Please commit your changes or stash them before you switch branches.
  Aborting
D:/a/ruby-git/ruby-git/lib/git/lib.rb:1144:in `command'
D:/a/ruby-git/ruby-git/lib/git/lib.rb:783:in `checkout'
D:/a/ruby-git/ruby-git/tests/units/test_lib.rb:86:in `test_checkout'
     83:
     84:   def test_checkout
     85:     assert(@lib.checkout('test_checkout_b',{:new_branch=>true}))
  => 86:     assert(@lib.checkout('test_checkout_b2', {new_branch: true, start_point: 'master'}))
     87:     assert(@lib.checkout('.'))
     88:     assert(@lib.checkout('master'))
     89:   end
===============================================================================

Comment thread lib/git/lib.rb Outdated
Comment thread tests/units/test_lib.rb Outdated
jcouball
jcouball previously approved these changes Oct 5, 2022

@jcouball jcouball left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you for the PR and the changes.

Co-authored-by: V.Kolesnikov <re.vkolesnikov@gmail.com>
Signed-off-by: Vasily Fedoseyev <vasilyfedoseyev@gmail.com>
@Vasfed

Vasfed commented Oct 5, 2022

Copy link
Copy Markdown
Contributor Author

Fixed tests on windows

@jcouball jcouball left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had missed the build errors during my last review but did notice them before merging.

Thank you for proactively fixing the problem.

@jcouball jcouball merged commit 74b8e11 into ruby-git:master Oct 5, 2022
@jcouball jcouball mentioned this pull request Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a new branch from a startpoint?

2 participants