Discussion:
[Pdl-porters] sf.net PDL git clean-up
Chris Marshall
2014-11-30 19:24:05 UTC
Permalink
All-

I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.

I found three branches that seem to be outdated
except for their final commit. I would request that
the original authors reply on their current status:

David Mertens:

parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..

fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?

Craig DeForest:

fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?

git Experts:

origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan

These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?


Thanks,
Chris
Ed .
2014-11-30 19:57:52 UTC
Permalink
git push origin --delete origin/fix-test-for-late-gcc

More generally:

git push $REMOTENAME --delete $BRANCHNAME

-----Original Message-----
From: Chris Marshall
Sent: Sunday, November 30, 2014 7:24 PM
To: pdl-porters
Cc: Craig DeForest ; David Mertens ; Guggle Worth
Subject: sf.net PDL git clean-up

All-

I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.

I found three branches that seem to be outdated
except for their final commit. I would request that
the original authors reply on their current status:

David Mertens:

parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..

fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?

Craig DeForest:

fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?

git Experts:

origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan

These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?


Thanks,
Chris
Chris Marshall
2014-11-30 22:49:45 UTC
Permalink
Thanks, Ed. --Chris
Post by Ed .
git push origin --delete origin/fix-test-for-late-gcc
git push $REMOTENAME --delete $BRANCHNAME
Chris Marshall
2014-11-30 23:32:26 UTC
Permalink
I was trying to checkout the remotes/origin/release_2.4.10 branch
but when I did, instead of getting a new tracking branch, I got the
following

git checkout release_2.4.10
Note: checking out 'release_2.4.10'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
git checkout -b new_branch_name
HEAD is now at 2b99ad7... Merge branch 'master' of ssh://
pdl.git.sourceforge.net/gitroot/pdl/pdl
It looks like something is not quite right here. Any ideas on
how to clean this up, Ed?
Thanks, Ed. --Chris
Post by Ed .
git push origin --delete origin/fix-test-for-late-gcc
git push $REMOTENAME --delete $BRANCHNAME
Ed .
2014-11-30 23:57:23 UTC
Permalink
Chris,

You might be better off anchoring that branch to a new name with “git checkout –b newname” and pushing that. I don’t know why it’s happened.

More generally, I think it is very poor practice to be making a branch for a release. That’s what “master” and tags are for. Is that possible in this situation?

Ed

From: Chris Marshall
Sent: Sunday, November 30, 2014 11:32 PM
To: Ed .
Cc: pdl-porters ; Craig DeForest ; David Mertens
Subject: Re: sf.net PDL git clean-up

I was trying to checkout the remotes/origin/release_2.4.10 branch
but when I did, instead of getting a new tracking branch, I got the
following



git checkout release_2.4.10
Note: checking out 'release_2.4.10'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 2b99ad7... Merge branch 'master' of ssh://pdl.git.sourceforge.net/gitroot/pdl/pdl



It looks like something is not quite right here. Any ideas on
how to clean this up, Ed?


On Sun, Nov 30, 2014 at 5:49 PM, Chris Marshall <***@gmail.com> wrote:

Thanks, Ed. --Chris
Post by Ed .
git push origin --delete origin/fix-test-for-late-gcc
git push $REMOTENAME --delete $BRANCHNAME
Chris Marshall
2014-12-01 01:19:51 UTC
Permalink
I was trying to delete it. Maybe with the anchor I can do so.
Regarding the release branches, those are a result of being
new[er] to git. I'd like to consolidate them but the initial cleanup
was to sort out some of the confusion that you had observed
previously---i.e. what the heck is going on with all these
branches... :-)

We have tags for the releases already AFICT. --Chris
Post by Ed .
Chris,
You might be better off anchoring that branch to a new name with “git
checkout –b newname” and pushing that. I don’t know why it’s happened.
More generally, I think it is very poor practice to be making a branch for
a release. That’s what “master” and tags are for. Is that possible in this
situation?
Ed
*Sent:* Sunday, November 30, 2014 11:32 PM
*Subject:* Re: sf.net PDL git clean-up
I was trying to checkout the remotes/origin/release_2.4.10 branch
but when I did, instead of getting a new tracking branch, I got the
following
git checkout release_2.4.10
Note: checking out 'release_2.4.10'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
git checkout -b new_branch_name
HEAD is now at 2b99ad7... Merge branch 'master' of ssh://
pdl.git.sourceforge.net/gitroot/pdl/pdl
It looks like something is not quite right here. Any ideas on
how to clean this up, Ed?
Thanks, Ed. --Chris
Post by Ed .
git push origin --delete origin/fix-test-for-late-gcc
git push $REMOTENAME --delete $BRANCHNAME
Ed .
2014-12-01 01:49:49 UTC
Permalink
To delete it, just use the “git push... –delete” from earlier?

From: Chris Marshall
Sent: Monday, December 01, 2014 1:19 AM
To: Ed .
Cc: pdl-porters ; Craig DeForest ; David Mertens
Subject: Re: sf.net PDL git clean-up

I was trying to delete it. Maybe with the anchor I can do so.

Regarding the release branches, those are a result of being
new[er] to git. I'd like to consolidate them but the initial cleanup
was to sort out some of the confusion that you had observed

previously---i.e. what the heck is going on with all these

branches... :-)


We have tags for the releases already AFICT. --Chris


On Sun, Nov 30, 2014 at 6:57 PM, Ed . <***@hotmail.com> wrote:

Chris,

You might be better off anchoring that branch to a new name with “git checkout –b newname” and pushing that. I don’t know why it’s happened.

More generally, I think it is very poor practice to be making a branch for a release. That’s what “master” and tags are for. Is that possible in this situation?

Ed

From: Chris Marshall
Sent: Sunday, November 30, 2014 11:32 PM
To: Ed .
Cc: pdl-porters ; Craig DeForest ; David Mertens
Subject: Re: sf.net PDL git clean-up

I was trying to checkout the remotes/origin/release_2.4.10 branch
but when I did, instead of getting a new tracking branch, I got the
following



git checkout release_2.4.10
Note: checking out 'release_2.4.10'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 2b99ad7... Merge branch 'master' of ssh://pdl.git.sourceforge.net/gitroot/pdl/pdl



It looks like something is not quite right here. Any ideas on
how to clean this up, Ed?


On Sun, Nov 30, 2014 at 5:49 PM, Chris Marshall <***@gmail.com> wrote:

Thanks, Ed. --Chris
Post by Ed .
git push origin --delete origin/fix-test-for-late-gcc
git push $REMOTENAME --delete $BRANCHNAME
Chris Marshall
2014-11-30 22:49:12 UTC
Permalink
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
This was fixed with Dima's implementation of flexible
sized arrays for pdl_trans so is not needed. Deleted.
Post by Chris Marshall
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
Chris Marshall
2014-11-30 23:02:26 UTC
Permalink
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
Chris Marshall
2014-11-30 23:25:38 UTC
Permalink
Post by Chris Marshall
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
Opened feature request #86 fix core eval strings for type conversions
as a placeholder for this development. fix-core-eval-strings has
been deleted.
Post by Chris Marshall
Post by Chris Marshall
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
David Mertens
2014-12-01 20:33:01 UTC
Permalink
For anybody who wants to see this branch, a copy still lives (for the
moment) at github:

https://github.com/PDLPorters/pdl/commits/fix-core-eval-strings

The problem is that some core datatype conversion functions are defined at
runtime using for loops over string evals, but they really, really should
be created using a for loop over a print statement at build time. The
resulting error messages would be much clearer, in my estimation. I would
love for this to be merged, but have run out of steam to get it pushed in.

David
Post by Chris Marshall
Post by Chris Marshall
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
Opened feature request #86 fix core eval strings for type conversions
as a placeholder for this development. fix-core-eval-strings has
been deleted.
Post by Chris Marshall
Post by Chris Marshall
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
Ed .
2014-12-03 17:25:35 UTC
Permalink
David,

I see the penultimate commit on that branch is a merge of master. Shouldn’t that be a rebase instead?

Ed

From: David Mertens
Sent: Monday, December 01, 2014 8:33 PM
To: Chris Marshall
Cc: pdl-porters ; Craig DeForest ; Guggle Worth
Subject: Re: sf.net PDL git clean-up

For anybody who wants to see this branch, a copy still lives (for the moment) at github:

https://github.com/PDLPorters/pdl/commits/fix-core-eval-strings


The problem is that some core datatype conversion functions are defined at runtime using for loops over string evals, but they really, really should be created using a for loop over a print statement at build time. The resulting error messages would be much clearer, in my estimation. I would love for this to be merged, but have run out of steam to get it pushed in.

David
Post by Chris Marshall
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
Opened feature request #86 fix core eval strings for type conversions
as a placeholder for this development. fix-core-eval-strings has
been deleted.
Post by Chris Marshall
Post by Chris Marshall
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
David Mertens
2014-12-14 21:25:58 UTC
Permalink
Probably. I read Pro Git a number of years ago, and my git foo has never
really expanded beyond that. Indeed, I probably didn't absorb some of the
latter parts of the book. Git rebasing was something that I never really
understood or practiced. Any good references for reading about git rebase
best practices?

David
Post by Ed .
David,
I see the penultimate commit on that branch is a merge of master.
Shouldn’t that be a rebase instead?
Ed
*Sent:* Monday, December 01, 2014 8:33 PM
*Subject:* Re: sf.net PDL git clean-up
https://github.com/PDLPorters/pdl/commits/fix-core-eval-strings
The problem is that some core datatype conversion functions are defined at
runtime using for loops over string evals, but they really, really should
be created using a for loop over a print statement at build time. The
resulting error messages would be much clearer, in my estimation. I would
love for this to be merged, but have run out of steam to get it pushed in.
David
Post by Chris Marshall
Post by Chris Marshall
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
Opened feature request #86 fix core eval strings for type conversions
as a placeholder for this development. fix-core-eval-strings has
been deleted.
Post by Chris Marshall
Post by Chris Marshall
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
Christian Walde
2014-12-14 22:48:01 UTC
Permalink
I can't recommend a book since i learned git by using it, but i can give
some best practices:

- always `git add -p`, any other type of add must be with the absolute
confidence that you know what you're doing
- if possible, use `git gui` to make commits
- don't `git pull`, it's a shortcut for `git fetch && git reset`, unless
you can accurately predict the result of a pull it's safer to do those
steps manually
- don't `git merge`, unless you know you want a merge commit (this is
something you only want in truly desperate situations, and i absolutely
and utterly mean desperate)
- don't `git rebase`, it's a shortcut for `git branch mark && git reset
<target> && git cherry-pick <old_commits> && git branch -D mark`, unless
you can accurately predict the result of a rebase it's safer to do those
steps manually
- if you'd really rather rebase than cherry-pick, always use `git rebase
-i`
- get something like tortoisegit to look at repo history. i think `git
gui` has a rudimentary one too. if nothing else is available, find a
solution from this page that works for you:
http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs

Finally, don't forget the man pages. You can find them online in nice
formatting.
--
With regards,
Christian Walde

On Sun, 14 Dec 2014 22:25:58 +0100, David Mertens
Post by David Mertens
Probably. I read Pro Git a number of years ago, and my git foo has never
really expanded beyond that. Indeed, I >probably didn't absorb some of
the latter parts of the book. Git rebasing was something that I never
really >understood or practiced. Any good references for reading about
git rebase best practices?
Tim Jenness
2014-12-14 22:59:09 UTC
Permalink
Ha.

I disagree with a lot of this. I always use 'git rebase' to keep my
branches up to date. I always merge feature branches to master with a
--no-ff merge as I want the merge commit to indicate what commits were part
of the feature. 'git pull --rebase' is also a good idea if others are
pushing and you are committing to master locally.

I do agree that extensive use of 'git diff' and 'git add' (with -p if
needed) is important and absolutely am against 'git commit -a'
--
Tim Jenness
Post by Christian Walde
I can't recommend a book since i learned git by using it, but i can give
- always `git add -p`, any other type of add must be with the absolute
confidence that you know what you're doing
- if possible, use `git gui` to make commits
- don't `git pull`, it's a shortcut for `git fetch && git reset`, unless
you can accurately predict the result of a pull it's safer to do those
steps manually
- don't `git merge`, unless you know you want a merge commit (this is
something you only want in truly desperate situations, and i absolutely and
utterly mean desperate)
- don't `git rebase`, it's a shortcut for `git branch mark && git reset
<target> && git cherry-pick <old_commits> && git branch -D mark`, unless
you can accurately predict the result of a rebase it's safer to do those
steps manually
- if you'd really rather rebase than cherry-pick, always use `git rebase
-i`
- get something like tortoisegit to look at repo history. i think `git
gui` has a rudimentary one too. if nothing else is available, find a
http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
Finally, don't forget the man pages. You can find them online in nice
formatting.
--
With regards,
Christian Walde
On Sun, 14 Dec 2014 22:25:58 +0100, David Mertens <
Probably. I read Pro Git a number of years ago, and my git foo has never
really expanded beyond that. Indeed, I probably didn't absorb some of the
latter parts of the book. Git rebasing was something that I never really
understood or practiced. Any good references for reading about git rebase
best practices?
_______________________________________________
PDL-porters mailing list
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters
Christian Walde
2014-12-14 23:41:48 UTC
Permalink
I've had this discussion a lot of times, and while i understand why you
disagree, i'll be the fucking blunt german i am, and bow to the reality
that there is no polite way to say what i'll need to say: Some of your
disagreements come from a lack of experience, compared to the body of
experience i have gathered in by working in a team with (notably) mst and
most of the core and toolchain hackers of Perl and CPAN. Also, frankly,
you have in part overread things i stated.

Then again, me addressing the points in detail will probably help
enlighten the other readers, or cement my position as a german git nazi,
giving me a decent enough chance of an outcome i prefer, and a chance at
I always use 'git rebase' to keep my branches up to date.
I assume you mean "feature branches". And, as i stated, it's fine to
rebase if "you can accurately predict the result". For someone asking for
materials to explain rebase and friends the likelihood of this being true
trends towards zero.

Also important to note here is that rebase can easily silently break
things. A rebase will try to automatically resolve things, and the bigger
the drift between your branch and the target you're rebasing onto, the
higher the likelihood that git's algorithm misunderstands your intentions
and resolves a conflict in a manner you didn't intend to. Doing a rebase
means trusting the machine, and you can only truly trust the machine if
you understand what it does.

At the very least one must create a marker branch head on one's old branch
head (as indicated in the steps alternate to rebase), so one can compare
the two after the rebase to see if git broke something.
I always merge feature branches to master with a --no-ff merge as I want
the merge commit to indicate what commits were part of the feature.
This can be appropiate if you are, as i stated "absolutely and utterly
[...] desperate", meaning you have a feature branch whose history is so
amazingly complicated and old that neither rebase of cherry-pick will
allow a clean-up while retaining sanity. In that case a merge commit is a
good label of "dragons be here".

However if you do it casually, all you're doing is making the history
graph of a repo an unreadable mess and the life of anyone needing to dig
in it to figure out by which combination of commits a certain bug was
spawned, a living hell.

The most that is acceptable is to do a merge --no-ff, always prefixed by a
rebase, under these conditions:

- the branch you're trying to integrate is a cthulhic mess and while you
can rebase it, trying to clean it up would ruin your sanity
- the branch contains commits that, out of technical necessity, cannot be
made without breaking the test suite
- the merge commit is entirely free of any additional changes, on penalty
of application of practices confined to carribean islands that have been
separated from modern civilization for centuries

In those cases it's nice to have a standalone merge commit as a "here be
dragons" marker, while retaining a strictly linear history.

Again, unless you are desperate and can with utter confidence articulate
why you are desperate, don't merge.
'git pull --rebase' is also a good idea if others are pushing and you
are committing to master locally.
This is actually a good point. However, let me point out that i still
managed to mess up the explanation of git pull, and should've said the
recommended steps are:

git fetch && git reset && git cherry-pick

This should be plenty of an example to explain why a beginner should
refrain from using the shortcuts.

Also, of note, while `git pull --rebase` is a good idea, it is only a good
idea with the general restriction of rebase, being "only do it if you can
accurately predict the result". Even with a plain rebase that goes through
uncontested there's a good chance that git's algorithm messes up and fixes
conflicts in a way you didn't intend.
'git add' (with -p if needed)
Always with -p. There is no useful difference between `git add` as a
standalone and `git commit -a` when it comes to the risk of creating
useless commits.

It's good though that we did agree on a few points. :)
--
With regards,
Christian Walde
Ha.
I disagree with a lot of this. I always use 'git rebase' to keep my
branches up to date. I always merge feature >branches to master with a
--no-ff merge as I want the merge commit to indicate what commits were
part of the >feature. 'git pull --rebase' is also a good idea if others
are pushing and you are committing to master locally.
I do agree that extensive use of 'git diff' and 'git add' (with -p if
needed) is important and absolutely am against >'git commit -a'
--Tim Jenness
On Sun, Dec 14, 2014 at 3:48 PM, Christian Walde
Post by Christian Walde
I can't recommend a book since i learned git by using it, but i can
- always `git add -p`, any other type of add must be with the absolute
confidence that you know what you're >>doing
- if possible, use `git gui` to make commits
- don't `git pull`, it's a shortcut for `git fetch && git reset`,
unless you can accurately predict the result of a >>pull it's safer to
do those steps manually
- don't `git merge`, unless you know you want a merge commit (this is
something you only want in truly >>desperate situations, and i
absolutely and utterly mean desperate)
- don't `git rebase`, it's a shortcut for `git branch mark && git
reset <target> && git cherry-pick >><old_commits> && git branch -D
mark`, unless you can accurately predict the result of a rebase it's
safer to >>do those steps manually- if you'd really rather rebase than
cherry-pick, always use `git rebase -i`
- get something like tortoisegit to look at repo history. i think `git
gui` has a rudimentary one too. if nothing >>else is available, find a
http://stackoverflow.com/>>questions/1057564/pretty-git-branch-graphs
Finally, don't forget the man pages. You can find them online in nice
formatting.
--With regards,
Christian Walde
Post by David Mertens
Post by Christian Walde
On Sun, 14 Dec 2014 22:25:58 +0100, David Mertens
Probably. I read Pro Git a number of years ago, and my git foo has
never really expanded beyond that. >>>Indeed, I probably didn't absorb
some of the latter parts of the book. Git rebasing was something that
I >>>never really understood or practiced. Any good references for
reading about git rebase best practices?
_______________________________________________
PDL-porters mailing list
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters
Tim Jenness
2014-12-15 00:49:00 UTC
Permalink
Post by Christian Walde
I've had this discussion a lot of times, and while i understand why you
disagree, i'll be the fucking blunt german i am, and bow to the reality
that there is no polite way to say what i'll need to say: Some of your
disagreements come from a lack of experience, compared to the body of
experience i have gathered in by working in a team with (notably) mst and
most of the core and toolchain hackers of Perl and CPAN. Also, frankly, you
have in part overread things i stated.
I have no real idea how to reply politely to this given that you don't know
how long I've been using git, how big my dev teams are and how fanatical I
am about a clean history.
Post by Christian Walde
I always use 'git rebase' to keep my branches up to date.
I assume you mean "feature branches". And, as i stated, it's fine to
rebase if "you can accurately predict the result". For someone asking for
materials to explain rebase and friends the likelihood of this being true
trends towards zero.
Also important to note here is that rebase can easily silently break
things. A rebase will try to automatically resolve things, and the bigger
the drift between your branch and the target you're rebasing onto, the
higher the likelihood that git's algorithm misunderstands your intentions
and resolves a conflict in a manner you didn't intend to. Doing a rebase
means trusting the machine, and you can only truly trust the machine if you
understand what it does.
Tests help. Small feature branches also help.
Post by Christian Walde
At the very least one must create a marker branch head on one's old branch
head (as indicated in the steps alternate to rebase), so one can compare
the two after the rebase to see if git broke something.
I always merge feature branches to master with a --no-ff merge as I want
the merge commit to indicate what commits were part of the feature.
This can be appropiate if you are, as i stated "absolutely and utterly
[...] desperate", meaning you have a feature branch whose history is so
amazingly complicated and old that neither rebase of cherry-pick will allow
a clean-up while retaining sanity. In that case a merge commit is a good
label of "dragons be here".
I should have said that the --no-ff is used after a rebase to highlight the
commits that were involved in the feature whilst retaining a linear commit
history. I never ever merge a branch without it being in a fast forward
state.
Post by Christian Walde
However if you do it casually, all you're doing is making the history
graph of a repo an unreadable mess and the life of anyone needing to dig in
it to figure out by which combination of commits a certain bug was spawned,
a living hell.
I hate unreadable messes in my git histories.
Post by Christian Walde
The most that is acceptable is to do a merge --no-ff, always prefixed by a
- the branch you're trying to integrate is a cthulhic mess and while you
can rebase it, trying to clean it up would ruin your sanity
- the branch contains commits that, out of technical necessity, cannot be
made without breaking the test suite
- the merge commit is entirely free of any additional changes, on penalty
of application of practices confined to carribean islands that have been
separated from modern civilization for centuries
so you always merge in new features as a single commit?
Post by Christian Walde
'git add' (with -p if needed)
Always with -p. There is no useful difference between `git add` as a
standalone and `git commit -a` when it comes to the risk of creating
useless commits.
If you've just done a git diff and can see what the git add will do then
the 'git add -p' is not actually needed.
--
Tim Jenness
Christian Walde
2014-12-15 01:34:32 UTC
Permalink
Post by Tim Jenness
I have no real idea how to reply politely
Don't. I don't mind facts and don't mind admitting when i'm wrong. :)
Post by Tim Jenness
Post by Christian Walde
Also important to note here is that rebase can easily silently break
things.
Tests help.
They do. However not all code is covered, and tests typically don't cover
documentation.
Post by Tim Jenness
Small feature branches also help.
They do. However i'd invite you to look at the PDL repo where feature
branches even of as little as 5 commits can span years and as many
additional synch merges.

At the end of the day you cannot safely do a rebase without comparing your
work to the result, and depending on what you're rebasing onto it's easier
to compare work with cherry-picks.
Post by Tim Jenness
I should have said that the --no-ff is used after a rebase to highlight
the commits that were involved in the feature whilst retaining a linear
commit history. I never ever merge a branch without it being in a fast
forward
state.
That's a good comment so i'm quoting it as true for others to read.
Post by Tim Jenness
I hate unreadable messes in my git histories.
Good to know we're on the same page on that. Would you agree that this
history is a mess too? https://github.com/PerlDancer/Dancer2/network (Imo
many of the feature branches are 3 commits (change, changelog, merge) when
they should be 1.)
Post by Tim Jenness
Post by Christian Walde
The most that is acceptable is to do a merge --no-ff, always prefixed
- the branch you're trying to integrate is a cthulhic mess and while you
can rebase it, trying to clean it up would ruin your sanity
- the branch contains commits that, out of technical necessity, cannot
be made without breaking the test suite
- the merge commit is entirely free of any additional changes, on
penalty of application of practices confined to carribean islands that
have been
separated from modern civilization for centuries
so you always merge in new features as a single commit?
No, i think squashing is not a helpful practice in general. I do however
always ensure that feature branches i do commit pass the entire test suite
at every point, thus making git bisect easier to do in the future and the
logic of the history easier to read later. For example when i'm
integrating a new feature into a function i'll often have one commit that
adds the new function and its tests; then another one that adds the calls
to the new functions in whatever other places need it, along with the
tests for that.

Or in other words, i subdivide every branch into minimally useful parts in
commits.
Post by Tim Jenness
If you've just done a git diff and can see what the git add will do then
the 'git add -p' is not actually needed.
You're right, that's legit.
--
With regards,
Christian Walde
David Mertens
2014-12-15 03:22:37 UTC
Permalink
Hey everyone,

I didn't mean to spawn this sort of discussion, but I hope it's helpful. I
trust that everybody who has spoken about git practices has quite a bit of
experience to back up their statements. What I do not expect to see (and
have not seen too much of) is a careful, thorough discussion of why
somebody would use one approach rather than another. Since there's no
reason to repeat what others have said, it would probably be most
constructive to find discussions or blog posts that articulate your
practice. This will let me get a much more complete picture for why certain
practices are preferred.

For example, here is a StackOverflow discussion about rebase vs merge
<http://stackoverflow.com/questions/804115/when-do-you-use-git-rebase-instead-of-git-merge>.
To summarize, a committer should rebase *their own topic branch* before
merging it into the main branch. Then, the committer's main branch will not
have any divergences and the history will be linear. Since lots of folks
work out of the master branch on their own machine, the suggestions for
"git pull --rebase" are essentially the same advice.

I had avoided rebase for reasons discussed in this (quite old) blog post
<http://changelog.complete.org/archives/586-rebase-considered-harmful>,
about how rebase changes history. Specifically, if you rebase *the master
branch* rather than your own topic branch, your co-coders will have trouble
pulling down the revised master branch. In light of the StackOverflow
discussion, this means that rebasing should predominantly happen only on a
private topic branch.

Overall, I think the most useful explanation of git-rebase, which was the
original catalyst for this discussion, is in this blog post
<http://darwinweb.net/articles/the-case-for-git-rebase>. I'm sure others
have put it well, this is just what I found.

David
On Sun, Dec 14, 2014 at 4:41 PM, Christian Walde <
Post by Christian Walde
I've had this discussion a lot of times, and while i understand why you
disagree, i'll be the fucking blunt german i am, and bow to the reality
that there is no polite way to say what i'll need to say: Some of your
disagreements come from a lack of experience, compared to the body of
experience i have gathered in by working in a team with (notably) mst and
most of the core and toolchain hackers of Perl and CPAN. Also, frankly, you
have in part overread things i stated.
I have no real idea how to reply politely to this given that you don't
know how long I've been using git, how big my dev teams are and how
fanatical I am about a clean history.
Post by Christian Walde
I always use 'git rebase' to keep my branches up to date.
I assume you mean "feature branches". And, as i stated, it's fine to
rebase if "you can accurately predict the result". For someone asking for
materials to explain rebase and friends the likelihood of this being true
trends towards zero.
Also important to note here is that rebase can easily silently break
things. A rebase will try to automatically resolve things, and the bigger
the drift between your branch and the target you're rebasing onto, the
higher the likelihood that git's algorithm misunderstands your intentions
and resolves a conflict in a manner you didn't intend to. Doing a rebase
means trusting the machine, and you can only truly trust the machine if you
understand what it does.
Tests help. Small feature branches also help.
Post by Christian Walde
At the very least one must create a marker branch head on one's old
branch head (as indicated in the steps alternate to rebase), so one can
compare the two after the rebase to see if git broke something.
I always merge feature branches to master with a --no-ff merge as I
want the merge commit to indicate what commits were part of the feature.
This can be appropiate if you are, as i stated "absolutely and utterly
[...] desperate", meaning you have a feature branch whose history is so
amazingly complicated and old that neither rebase of cherry-pick will allow
a clean-up while retaining sanity. In that case a merge commit is a good
label of "dragons be here".
I should have said that the --no-ff is used after a rebase to highlight
the commits that were involved in the feature whilst retaining a linear
commit history. I never ever merge a branch without it being in a fast
forward state.
Post by Christian Walde
However if you do it casually, all you're doing is making the history
graph of a repo an unreadable mess and the life of anyone needing to dig in
it to figure out by which combination of commits a certain bug was spawned,
a living hell.
I hate unreadable messes in my git histories.
Post by Christian Walde
The most that is acceptable is to do a merge --no-ff, always prefixed by
- the branch you're trying to integrate is a cthulhic mess and while you
can rebase it, trying to clean it up would ruin your sanity
- the branch contains commits that, out of technical necessity, cannot be
made without breaking the test suite
- the merge commit is entirely free of any additional changes, on penalty
of application of practices confined to carribean islands that have been
separated from modern civilization for centuries
so you always merge in new features as a single commit?
Post by Christian Walde
'git add' (with -p if needed)
Always with -p. There is no useful difference between `git add` as a
standalone and `git commit -a` when it comes to the risk of creating
useless commits.
If you've just done a git diff and can see what the git add will do then
the 'git add -p' is not actually needed.
--
Tim Jenness
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
Christian Walde
2014-12-15 04:21:30 UTC
Permalink
On Mon, 15 Dec 2014 04:22:37 +0100, David Mertens
Specifically, if you rebase *the master branch* rather than your own
topic branch, your co-coders will have trouble pulling down the revised
master branch.
In general yes. Rebasing master should only happen to fix bigger fuckups
somebody made. And indelicately speaking, depending on the experience
level of the general contributor populace sometimes even that is not a
realistic option.

Also, nothing should be on master that doesn't work or isn't sincerely
intended to be released.
In light of the StackOverflow discussion, this means that rebasing
should predominantly happen only on a private topic branch.
Depends on your definition of "private". If you mean only unpushed
branches should be rebased, then that's off. Basically all branches that
are not master, or master-like (like branches preparing a release), are
not only open targets for rebases, but required to be rebased before
integration.

I think Tim and i are on the same page that rebasing is a must, just not
on the same page about the exact procedure by which to do it.
--
With regards,
Christian Walde
Ed .
2014-12-14 22:54:25 UTC
Permalink
David,

The way I learned it was basically Google and Stack Exchange questions. I’ll be pleased to take any- and everyone interested through a masterclass on IRC #pdl with their specific branch issues.

Short version, which I have been doing today on EUMM:
git fetch --all # gets upstream/master
git checkout master # my local one
git rebase upstream/master # brings my local one up to date, this is key – if you’re not using a fork, don’t do this or next step
git push # makes “my” origin/master be up to date with upstream – only if you have your own fork
git checkout myfunkybranch
git rebase master # will unwind your commits, then reapply to latest and greatest master – this is a key one, may involve editing
git push -f # don’t be afraid of the force-push here, it’s expected when on branches

If someone else did a force-push on a branch on origin or upstream, you can get your copy in sync with “git pull --rebase"

“git rebase” is very clever and generally does what you would expect/hope it to do. If it goes badly-enough wrong, you can always “git reflog” to find a known-sane point, then eg “git reset @{7}”.

Generally “git pull” is not your friend, because it does a fetch then a merge, and usually you want to rebase. I think there’s a config option to switch the default, but I just don’t use pull.

Ed J

From: David Mertens
Sent: Sunday, December 14, 2014 9:25 PM
To: Ed .
Cc: pdl-porters
Subject: Re: sf.net PDL git clean-up

Probably. I read Pro Git a number of years ago, and my git foo has never really expanded beyond that. Indeed, I probably didn't absorb some of the latter parts of the book. Git rebasing was something that I never really understood or practiced. Any good references for reading about git rebase best practices?


David


On Wed, Dec 3, 2014 at 12:25 PM, Ed . <***@hotmail.com> wrote:
David,

I see the penultimate commit on that branch is a merge of master. Shouldn’t that be a rebase instead?

Ed

From: David Mertens
Sent: Monday, December 01, 2014 8:33 PM
To: Chris Marshall
Cc: pdl-porters ; Craig DeForest ; Guggle Worth
Subject: Re: sf.net PDL git clean-up

For anybody who wants to see this branch, a copy still lives (for the moment) at github:

https://github.com/PDLPorters/pdl/commits/fix-core-eval-strings


The problem is that some core datatype conversion functions are defined at runtime using for loops over string evals, but they really, really should be created using a for loop over a print statement at build time. The resulting error messages would be much clearer, in my estimation. I would love for this to be merged, but have run out of steam to get it pushed in.

David
Post by Chris Marshall
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
Opened feature request #86 fix core eval strings for type conversions
as a placeholder for this development. fix-core-eval-strings has
been deleted.
Post by Chris Marshall
Post by Chris Marshall
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
--

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
David Mertens
2014-12-01 20:26:25 UTC
Permalink
Huh, I had always wondered what happened to that work. I had forgotten that
it *hadn't* been worked into the main branch. Since the file in question is
only a documentation file, I would like if this could be worked into the
next release of PDL, whichever and whenever that happens to be.

David
Post by Chris Marshall
Post by Chris Marshall
All-
I've been reviewing the set of branches on our sf.net
git repository and have deleted a number that have
already been merged into the master development
branch or another active branch.
I found three branches that seem to be outdated
except for their final commit. I would request that
parallelcpu - This branch ends with a change in the
module name from PDL::ParallelCPU to the separated
PDL::Parallel::CPU. What are your current feelings
about this? My thought is that we could leave it the
way it is for now until the PDL3 work or its ilk results
in a real PDL::Parallel namespace..
Opened feature request #85 better name for PDL::ParallelCPU
as a placeholder. parallelcpu has been deleted.
Post by Chris Marshall
fix-core-eval-strings - this has an updated explanation
to Core.pm.PL. Could it be applied to the current
master and then delete the branch?
fix-test-for-late-gcc - What was the problem here and
is it fixed in the current PDL master?
origin/origin/fix-test-for-late-gcc
origin/remotes/origin/cpan
These two branches have extra origin or remotes or
both in their pathnames. How do I clean them up?
Thanks,
Chris
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
Loading...