lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shad Storhaug <>
Subject RE: SearcherLifetimeManager bug correction
Date Sun, 30 Jul 2017 23:38:04 GMT

To separate commits, you need to create branches. Each branch is like a bucket of commits
(and yes, it will include all of the commit history for that branch). But each branch can
keep track of a separate changeset (feature or bug fix).

For example, to create a branch with only this commit, you can use the cherry-pick command
to move it to a new branch. But to make it ripe to consume, you would need to first track
the history of the master branch on a new working branch (skip to below to first "save" your
current work to a new branch and reset master before doing these steps).

First pull down the latest commits from master:

git pull upstream master

This assumes your remote to the Apache lucenenet GitHub repository is named "upstream". Note
you can replace upstream with the URL It also assumes
none of your existing work is on master (once again, skip below to clean up).

Then, make sure you have the master branch checked out:

git checkout master

Next, create a new branch to put your work:

git checkout -b vincents-amazing-patch

This will create a branch and check it out in one command. So, you will now be on a branch
named vincents-amazing-patch. It's time to grab your commit. You don't need to know what branch
it is on, just the first few characters of the commit hash:

 git cherry-pick 5f42491

That will copy everything from your patch to the current branch. From there you can push it
to your GitHub fork:

git push origin vincents-amazing-patch

Assuming your remote is named origin. And then you can use the GitHub website to submit a
pull request from there.

To view the list of remote names and their corresponding URLs, use:

git remote -v



This is essentially the same as what is here:

Now, assuming you weren't using branches to begin with, most likely all of your existing commits
are on the master branch. Therefore, you will need to do a bit of cleanup work before running
the above commands. Start by making a new branch. This will "save" all of your existing commits
and free up master to be used only for synchronization purposes.

git branch vincents-wip

Assuming you are on master when you start the command (if not, "git checkout master"), this
will backup everything you have done on master on a new branch named vincents-wip. You can
see the branches you have by using:

git branch

Then you should reset master back to the original state at GitHub:

git fetch upstream
git checkout master
git reset --hard upstream/master

That will grab the latest stuff from GitHub and then reset master to exactly the same state
as what is on GitHub. From this state, you can start the above commands to create a new branch
(based on master) and cherry pick your one commit to that branch.

In general, when working you should keep master available to pull from and only commit to
custom branches you make. These working branches can then also be made into individual pull


One thing to note about Git that is different than some other version control systems is that
when you checkout a branch, it will do it in the same local directory you are in. So, it will
effectively replace the entire directory with the currently checked out branch. Don't worry
- your work didn't disappear, it is just in the repo somewhere waiting to be checked out.

However, the advantages of not having to use separate local directories for branches are numerous
- especially when doing web development where you have a server that expects your web site
to be in a specific folder. A simple checkout command to change to a different set of code
is far easier than reconfiguring your webserver and other dependencies to where your new working
directory is located.



I am almost finished - there are 3 tests that never finish due to concurrency issues. I might
be seeking your help again on this, but let me finish up the API accessibility and give the
concurrency bug another shot first.

Shad Storhaug (NightOwl888)

-----Original Message-----
From: Van Den Berghe, Vincent [] 
Sent: Sunday, July 30, 2017 11:46 PM
Subject: SearcherLifetimeManager bug correction

... but for the life of me, I can't figure out how to use only this as a push request. The
systems seems to want to include all the commits up to this point.


View raw message