Re: Pitfalls in auto-fast-forwarding heads that are not checked out?

2013-05-07 Thread Martin Langhoff
On Sat, May 4, 2013 at 2:51 PM, Jonathan Nieder jrnie...@gmail.com wrote: Another trick is to use git push: git push . $production_sha1:refs/heads/master Great trick -- thanks! In use in ppg now :-) m -- martin.langh...@gmail.com - ask interesting questions - don't get distracted

Re: Pitfalls in auto-fast-forwarding heads that are not checked out?

2013-05-04 Thread Johannes Sixt
Am 04.05.2013 00:46, schrieb Martin Langhoff: I am building a small git wrapper around puppet, and one of the actions it performs is auto-fastforwarding of branches without checking them out. In simplified code... we ensure that we are on a head called master, and in some cases ppg commit,

Re: Pitfalls in auto-fast-forwarding heads that are not checked out?

2013-05-04 Thread Martin Langhoff
On Sat, May 4, 2013 at 3:34 AM, Johannes Sixt j...@kdbg.org wrote: You mean refs/heads/master and != here because -ne is numeric comparison in a shell script. thanks! Yeah, I fixed those up late last night :-) Since git 1.8.0 you can express this check as if git merge-base --is-ancestor

Re: Pitfalls in auto-fast-forwarding heads that are not checked out?

2013-05-04 Thread John Szakmeister
On Sat, May 4, 2013 at 7:35 AM, Martin Langhoff martin.langh...@gmail.com wrote: [snip] When I do git pull, git is careful to only update the branch I have checked out (if appropriate). It leaves any other branches that track branches on the remote that has just been fetched untouched. I always

Re: Pitfalls in auto-fast-forwarding heads that are not checked out?

2013-05-04 Thread Jonathan Nieder
Martin Langhoff wrote: On Sat, May 4, 2013 at 3:34 AM, Johannes Sixt j...@kdbg.org wrote: Since git 1.8.0 you can express this check as if git merge-base --is-ancestor $production_sha1 refs/heads/master Ah, that's great! Unfortunate it's not there in earlier / more widely used releases

Pitfalls in auto-fast-forwarding heads that are not checked out?

2013-05-03 Thread Martin Langhoff
I am building a small git wrapper around puppet, and one of the actions it performs is auto-fastforwarding of branches without checking them out. In simplified code... we ensure that we are on a head called master, and in some cases ppg commit, will commit to master and... ## early on #