lucenenet-dev mailing list archives

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

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 https://github.com/apache/lucenenet.git. 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

---------------------------------

Setup

This is essentially the same as what is here: https://stackoverflow.com/questions/1628088/reset-local-repository-branch-to-be-just-like-remote-repository-head

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
requests.

---------------------------------

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.

---------------------------------

Benchmark

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.


Thanks,
Shad Storhaug (NightOwl888)


-----Original Message-----
From: Van Den Berghe, Vincent [mailto:Vincent.VanDenBerghe@bvdinfo.com] 
Sent: Sunday, July 30, 2017 11:46 PM
To: dev@lucenenet.apache.org
Subject: SearcherLifetimeManager bug correction

See https://github.com/vvdb/lucenenet/commit/5f42491787fa01b539f62cb078139fca08d6cb40
... 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.

Vincent

Mime
View raw message