Re: [GRASS-dev] git: how to avoid bogus merge commits

2019-05-23 Thread Panagiotis Mavrogiorgos
st 22. 5. 2019 v 21:44 odesílatel Even Rouault
>  > napsal:
> >* git fetch origin  (assuming 'origin' point to OSGeo/grass)
> *>* git rebase origin/master
> *
> or possibly
> git pull --rebase


git pull --rebase can be indeed used to the same effect. You can even add

[pull]

rebase = true

to your .gitconfig.

Nevertheless, IMHV it is still a better idea to use a personal fork + Pull
Requests instead of the main repo. With this workflow, even if you do
something messy you can always sort it out without adding noise to history

I have updated the section
> Keep your local source code up to date
> https://trac.osgeo.org/grass/wiki/HowToGit#Keepyourlocalsourcecodeuptodate


The stash step was wrong. I fixed it. In order to reapply the stash you
need:

git stash apply && git stash pop

This way the stash is being popped if and only if it has been applied
cleanly. If there are conflicts you can reset the repo without losing your
stash (which you might want to apply to a different branch etc).

P.
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] git: how to avoid bogus merge commits

2019-05-22 Thread Vaclav Petras
On Wed, May 22, 2019 at 3:31 PM Markus Metz 
wrote:

>
> Of course I could (should) do a "git pull" before a "git push", but I
> think it is not uncommon that someone forgets the "git pull" before the
> "git push".
>

It is not that executing push before pull causes problems. You simply need
to do pull when the branch in remote repo changed.

You would need to do pull before commit. If you do commit before pull,
rebasing (as suggested by Even) then redos the commits on top of updated
branch as if you would do them after pull.

It is the "Git is not Subversion" song. As far as I understood, Subversion
is similar to CVS. However, Git is *very* different than CVS: "Take
Concurrent Versions System (CVS) as an example of what not to do; if in
doubt, make the exact opposite decision." [1]

[1] https://en.wikipedia.org/wiki/Git#History
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] git: how to avoid bogus merge commits

2019-05-22 Thread Martin Landa
Hi,

st 22. 5. 2019 v 21:44 odesílatel Even Rouault
 napsal:
> git fetch origin  (assuming 'origin' point to OSGeo/grass)
> git rebase origin/master

or possibly

git pull --rebase

could be used? Ma

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] git: how to avoid bogus merge commits

2019-05-22 Thread Markus Neteler
On Wed, May 22, 2019 at 9:44 PM Even Rouault  wrote:
>
> On mercredi 22 mai 2019 21:30:58 CEST Markus Metz wrote:
> > Hi git gurus,
> >
> > when I modify my local copy and do git commit + git push, I sometimes get
> > an error:
> > "failed to push some refs"
> > and a hint:
> > "Updates were rejected because the remote contains work that you do not
> > have locally. This is usually caused by another repository pushing to the
> > same ref. You may want to first integrate the remote changes (e.g., 'git
> > pull ...') before pushing again."
> >
> > OK, I do "git pull" and get confronted with a merge commit message.
>
> You may do
>
> git fetch origin  (assuming 'origin' point to OSGeo/grass)
> git rebase origin/master
> git push
>
> this will rebase your local commit(s) on top of latest upstream repo

Thanks, Even,

I have updated the section
Keep your local source code up to date
https://trac.osgeo.org/grass/wiki/HowToGit#Keepyourlocalsourcecodeuptodate

best
markusN
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] git: how to avoid bogus merge commits

2019-05-22 Thread Even Rouault
On mercredi 22 mai 2019 21:30:58 CEST Markus Metz wrote:
> Hi git gurus,
> 
> when I modify my local copy and do git commit + git push, I sometimes get
> an error:
> "failed to push some refs"
> and a hint:
> "Updates were rejected because the remote contains work that you do not
> have locally. This is usually caused by another repository pushing to the
> same ref. You may want to first integrate the remote changes (e.g., 'git
> pull ...') before pushing again."
> 
> OK, I do "git pull" and get confronted with a merge commit message.

You may do

git fetch origin  (assuming 'origin' point to OSGeo/grass)
git rebase origin/master
git push

this will rebase your local commit(s) on top of latest upstream repo

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] git: how to avoid bogus merge commits

2019-05-22 Thread Markus Metz
Hi git gurus,

when I modify my local copy and do git commit + git push, I sometimes get
an error:
"failed to push some refs"
and a hint:
"Updates were rejected because the remote contains work that you do not
have locally. This is usually caused by another repository pushing to the
same ref. You may want to first integrate the remote changes (e.g., 'git
pull ...') before pushing again."

OK, I do "git pull" and get confronted with a merge commit message.

After that, I do "git push" and commit a merge that does nothing.

Of course I could (should) do a "git pull" before a "git push", but I think
it is not uncommon that someone forgets the "git pull" before the "git
push". Therefore I would like to know how I can get rid of this bogus merge
commit that changes nothing but spams the history, and burns Travis CI,
e.g.  [1, 2].

Thanks,

Markus M

[1] https://travis-ci.com/OSGeo/grass/builds/112790153
[2] https://travis-ci.com/OSGeo/grass/builds/112567602
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev