You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by sebb <se...@gmail.com> on 2019/03/10 11:50:32 UTC

[git] How to update local clone of vlsi/jmeter/gradle

I have been unable to work out how to update my clone of the Gradle
experiment at

https://github.com/vlsi/jmeter.git (branch gradle)

$ git status
Your branch and 'origin/gradle' have diverged,
and have 28 and 69 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

[However, I have not made any local changes]

I tried git pull, but that gave me lots of conflict warnings.

I ended up having to clone the branch again, but that is quite slow,
and is surely not necessary?

S.

Re: [git] How to update local clone of vlsi/jmeter/gradle

Posted by Vladimir Sitnikov <si...@gmail.com>.
sebb>Why is it necessary to reset?

It is described in https://git-scm.com/book/en/v2/Git-Branching-Rebasing

I do rebase from time to time (which you can see as "vlsi force-pushed the
vlsi:gradle branch" in the GitHub UI)

The case for rebase is to combine individual commits and pretend as if I
developed "a very clever" commit right from the start.

For instance:
Here's a commit where I accidentally deleted WitnessPlugin.kt file:
https://github.com/apache/jmeter/pull/448/commits/0084222ab06a374b9949b57cf50b370aed7ff0d1
Here's a commit where I re-added it:
https://github.com/apache/jmeter/pull/448/commits/7e29d86ae62b7ab06388200df03e8c7391103256

Later (e.g. today) I will combine those so the git history would look
simpler and easier to follow.

sebb> I have other clones where I don't update locally, and git pull works
fine.

Well, git pull == git fetch + git merge. I don't like "accidental
unexpected merge", so I've never really used git pull.

I learned gitk tool long ago to visualize git history, and I use it
extensively (even though the tool is quite old).
Note: in macOS you want to use mac's wish instead of X11-based Tcl/tk.
However that depends on the way you install git (I use MacPorts+Nixpkgs mix
for fun purposes).

My typical flow is:
1) git fetch # fetch server-side changes
2) gitk --all # show history with all the branches

The tree there grows from bottom, so you can browse what really have
changed since your last fetch.
You see how branches divert (if they do).
You can reset from gitk as well (which I do quite often). That is you
pin-point the commit, right-click it and reset to that state.

There are other "cool" tools like GitUp, however I failed to adopt them.
gitk seems to be good enough for me.

Vladimir

Re: [git] How to update local clone of vlsi/jmeter/gradle

Posted by sebb <se...@gmail.com>.
On Sun, 10 Mar 2019 at 12:42, sebb <se...@gmail.com> wrote:
>
> On Sun, 10 Mar 2019 at 12:22, Vladimir Sitnikov
> <si...@gmail.com> wrote:
> >
> > sebb, do you have local changes?
>
> No.
>
> > If no, then the following commands would help:
> >
> > I assume you've added my repo as vlsi:
>
> Not sure what you mean by that.
>
> I think I used 'git clone -b gradle --depth 1
> https://github.com/vlsi/jmeter.git'
>
> $ git remote -v
> origin https://github.com/vlsi/jmeter.git (fetch)
> origin https://github.com/vlsi/jmeter.git (push)
>
> > git fetch vlsi
> > git reset --hard vlsi/gradle
> >
> > If you cloned my repository as origin, then the following would do:
> > git fetch
> > git reset --hard origin/gradle

Thanks, that did work, and was much quicker than cloning again.

> Why is it necessary to reset?
>
> I have other clones where I don't update locally, and git pull works fine.
>
> > Vladimir
> >
> > >
> > >

Re: [git] How to update local clone of vlsi/jmeter/gradle

Posted by sebb <se...@gmail.com>.
Thanks, that's very useful.

On Sun, 10 Mar 2019 at 17:10, Vladimir Sitnikov
<si...@gmail.com> wrote:
>
> sebb> Not sure what you mean by that.
>
> I think the suggested flow is as follows:
>
> 1) "Clone Apache JMeter repository"
>
> $ git clone https://github.com/apache/jmeter.git
>
> This creates "jmeter" directory with "origin" pointing to "apache/jmeter.git"
>
> Then  "git fetch" could be used to fetch updates from "apache/jmeter" repository
>
> 2) "Add side repository". It might be useful to track progress of a side branch.
> It might be useful to have "own" repository.
>
> $ git remote add vlsi https://github.com/vlsi/jmeter.git
>
> Then "git fetch vlsi" would fetch updates from vlsi/jmeter repository.
>
> It is exactly what I do, however I use "vs" name for my own
> repositories for brevity.
>
> "gitk --all" could be used to visualize current history (so
> origin/trunk represents current JMeter trunk, and vlsi/gradle
> represents my gradle branch)
>
> For now I have:
>
> $ git remote -v show
> origin https://github.com/apache/jmeter.git (fetch)
> origin https://github.com/apache/jmeter.git (push)
> vs https://github.com/vlsi/jmeter.git (fetch)
> vs https://github.com/vlsi/jmeter.git (push)
>
> 3) When we use Apache GitBox, committers would even have rights to
> update PRs by pushing to "other people's repositories".
> This is helps as sometimes it is much simpler for committer to update
> minor issues and update the branch to trigger CI rather than discuss
> that in comments.
>
> Vladimir

Re: [git] How to update local clone of vlsi/jmeter/gradle

Posted by Vladimir Sitnikov <si...@gmail.com>.
sebb> Not sure what you mean by that.

I think the suggested flow is as follows:

1) "Clone Apache JMeter repository"

$ git clone https://github.com/apache/jmeter.git

This creates "jmeter" directory with "origin" pointing to "apache/jmeter.git"

Then  "git fetch" could be used to fetch updates from "apache/jmeter" repository

2) "Add side repository". It might be useful to track progress of a side branch.
It might be useful to have "own" repository.

$ git remote add vlsi https://github.com/vlsi/jmeter.git

Then "git fetch vlsi" would fetch updates from vlsi/jmeter repository.

It is exactly what I do, however I use "vs" name for my own
repositories for brevity.

"gitk --all" could be used to visualize current history (so
origin/trunk represents current JMeter trunk, and vlsi/gradle
represents my gradle branch)

For now I have:

$ git remote -v show
origin https://github.com/apache/jmeter.git (fetch)
origin https://github.com/apache/jmeter.git (push)
vs https://github.com/vlsi/jmeter.git (fetch)
vs https://github.com/vlsi/jmeter.git (push)

3) When we use Apache GitBox, committers would even have rights to
update PRs by pushing to "other people's repositories".
This is helps as sometimes it is much simpler for committer to update
minor issues and update the branch to trigger CI rather than discuss
that in comments.

Vladimir

Re: [git] How to update local clone of vlsi/jmeter/gradle

Posted by sebb <se...@gmail.com>.
On Sun, 10 Mar 2019 at 12:22, Vladimir Sitnikov
<si...@gmail.com> wrote:
>
> sebb, do you have local changes?

No.

> If no, then the following commands would help:
>
> I assume you've added my repo as vlsi:

Not sure what you mean by that.

I think I used 'git clone -b gradle --depth 1
https://github.com/vlsi/jmeter.git'

$ git remote -v
origin https://github.com/vlsi/jmeter.git (fetch)
origin https://github.com/vlsi/jmeter.git (push)

> git fetch vlsi
> git reset --hard vlsi/gradle
>
> If you cloned my repository as origin, then the following would do:
> git fetch
> git reset --hard origin/gradle

Why is it necessary to reset?

I have other clones where I don't update locally, and git pull works fine.

> Vladimir
>
> >
> >

Re: [git] How to update local clone of vlsi/jmeter/gradle

Posted by Vladimir Sitnikov <si...@gmail.com>.
sebb, do you have local changes?
If no, then the following commands would help:

I assume you've added my repo as vlsi:
git fetch vlsi
git reset --hard vlsi/gradle

If you cloned my repository as origin, then the following would do:
git fetch
git reset --hard origin/gradle

Vladimir

>
>