Skip to content

Commit

Permalink
Incorporated aanand/git-up#41; added Changelog
Browse files Browse the repository at this point in the history
Added the changes from aanand/git-up#41. Gonna release it, when
it's in git-up's master.
  • Loading branch information
msiemens committed Mar 14, 2013
1 parent bffc8d2 commit 155e52d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
10 changes: 6 additions & 4 deletions PyGitUp/gitup.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,14 @@ def check_bundler(self):
"""
Run the bundler check.
"""
def get_config(name):
return name if self.config('bundler.' + name) else ''

from pkg_resources import Requirement, resource_filename
bundler_script = resource_filename(Requirement.parse("git-up"),
bundler_script = resource_filename(Requirement.parse('git-up'),
'check-bundler.rb')
autoinstall = 'autoinstall' if self.config('bundler.autoinstall') \
else ''
subprocess.call(['ruby', bundler_script, autoinstall])
subprocess.call(['ruby', bundler_script, get_config('autoinstall'),
get_config('local'), get_config('rbenv')])

###############################################################################

Expand Down
34 changes: 29 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
PyGitUp
=======

|Build Status|
PyGitUp |Build Status|
======================

``PyGitUp`` is a Python implementation of the great
`aanand/git-up/ <https://github.com/aanand/git-up/>`__. Right now it
Expand All @@ -13,7 +11,7 @@ Why using ``git up``?

git pull has two problems:

* It merges upstream changes by default, when it's really more polite to rebase over them, unless your collaborators enjoy a commit graph that looks like bedhead.
* It merges upstream changes by default, when it's really more polite to rebase over them, unless your collaborators enjoy a commit graph that looks like bedhead.

* It only updates the branch you're currently on, which means git push will shout at you for being behind on branches you don't particularly care about right now.

Expand Down Expand Up @@ -73,6 +71,19 @@ options:
``true``,\ ``PyGitUp`` will run ``bundle install`` automatically.
Requires ``git-up.bundler.check`` to be true.

- ``git-up.bundler.local [true|*false*]:`` If you've ``bundle package``-ed
your project gems, you can tell ``PyGitUp`` to run ``bundle install
--local`` for you if it finds missing gems. Much faster than just a plain
old ``bundle install``. Don't worry if you're missing gems, it will
backtrack to ``bundle install`` if anything goes wrong. Make sure
``git-up.bundler.autoinstall`` is also set to ``true`` or it won't do
anything.

- ``git-up.bundler.rbenv [true|false]:`` If you have rbenv installed,
you can tell ``PyGitUp`` to run ``rbenv rehash`` for you after it installs
your gems so any binaries will be available right away. Make sure ``git-up
.bundler.autoinstall`` is also set to ``true`` or it won't do anything.

- ``git-up.fetch.prune [*true*|false]:`` If set to ``true``,
``PyGitUp`` will append the ``--prune``\ option to ``git fetch`` and
thus removing any remote tracking branches which no longer exist on
Expand Down Expand Up @@ -109,5 +120,18 @@ The original ``git-up`` has been written by aanand:
`aanand/git-up/ <https://github.com/aanand/git-up/>`__.


Changelog
---------

v0.2 (*2013-03-XX*)
~~~~~~~~~~~~~~~~~~~

- Incorporated `aanand/git-up#41 <https://github.com/aanand/git-up/pull/41>`__

v0.1 (*2013-03-14*)
~~~~~~~~~~~~~~~~~~

- Initial Release

.. |Build Status| image:: https://travis-ci.org/msiemens/PyGitUp.png?branch=dev
:target: https://travis-ci.org/msiemens/PyGitUp
22 changes: 18 additions & 4 deletions check-bundler.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code adapted from: https://github.com/aanand/git-up/blob/master/lib/git-up.rb#L162-L181
# Code adapted from: https://github.com/aanand/git-up/blob/master/lib/git-up.rb#L162-L194
require 'colored'

def check_bundler
Expand All @@ -11,12 +11,26 @@ def check_bundler
puts
print 'Gems are missing. '.yellow

if ARGV[0] == 'autoinstall'
puts "Running `bundle install`.".yellow
system "bundle", "install"
if ARGV.include? 'autoinstall'
if ARGV.include? 'local'
puts "Running `bundle install --local`.".yellow
unless system "bundle", "install", "--local"
puts "Problem running `bundle install --local`. Running `bundle install` instead.".yellow
system "bundle", "install"
end
else
puts "Running `bundle install`.".yellow
system "bundle", "install"
end

if ARGV.include? 'rbenv'
puts "Running `rbenv rehash`.".yellow
system "rbenv", "rehash"
end
else
puts "You should `bundle install`.".yellow
end

end
end

Expand Down

0 comments on commit 155e52d

Please sign in to comment.