Skip to content

Commit 155e52d

Browse files
committed
Incorporated aanand/git-up#41; added Changelog
Added the changes from aanand/git-up#41. Gonna release it, when it's in git-up's master.
1 parent bffc8d2 commit 155e52d

File tree

3 files changed

+53
-13
lines changed

3 files changed

+53
-13
lines changed

PyGitUp/gitup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,14 @@ def check_bundler(self):
279279
"""
280280
Run the bundler check.
281281
"""
282+
def get_config(name):
283+
return name if self.config('bundler.' + name) else ''
284+
282285
from pkg_resources import Requirement, resource_filename
283-
bundler_script = resource_filename(Requirement.parse("git-up"),
286+
bundler_script = resource_filename(Requirement.parse('git-up'),
284287
'check-bundler.rb')
285-
autoinstall = 'autoinstall' if self.config('bundler.autoinstall') \
286-
else ''
287-
subprocess.call(['ruby', bundler_script, autoinstall])
288+
subprocess.call(['ruby', bundler_script, get_config('autoinstall'),
289+
get_config('local'), get_config('rbenv')])
288290

289291
###############################################################################
290292

README.rst

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
PyGitUp
2-
=======
3-
4-
|Build Status|
1+
PyGitUp |Build Status|
2+
======================
53

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

1412
git pull has two problems:
1513

16-
* 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.
14+
* 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.
1715

1816
* 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.
1917

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

74+
- ``git-up.bundler.local [true|*false*]:`` If you've ``bundle package``-ed
75+
your project gems, you can tell ``PyGitUp`` to run ``bundle install
76+
--local`` for you if it finds missing gems. Much faster than just a plain
77+
old ``bundle install``. Don't worry if you're missing gems, it will
78+
backtrack to ``bundle install`` if anything goes wrong. Make sure
79+
``git-up.bundler.autoinstall`` is also set to ``true`` or it won't do
80+
anything.
81+
82+
- ``git-up.bundler.rbenv [true|false]:`` If you have rbenv installed,
83+
you can tell ``PyGitUp`` to run ``rbenv rehash`` for you after it installs
84+
your gems so any binaries will be available right away. Make sure ``git-up
85+
.bundler.autoinstall`` is also set to ``true`` or it won't do anything.
86+
7687
- ``git-up.fetch.prune [*true*|false]:`` If set to ``true``,
7788
``PyGitUp`` will append the ``--prune``\ option to ``git fetch`` and
7889
thus removing any remote tracking branches which no longer exist on
@@ -109,5 +120,18 @@ The original ``git-up`` has been written by aanand:
109120
`aanand/git-up/ <https://github.com/aanand/git-up/>`__.
110121

111122

123+
Changelog
124+
---------
125+
126+
v0.2 (*2013-03-XX*)
127+
~~~~~~~~~~~~~~~~~~~
128+
129+
- Incorporated `aanand/git-up#41 <https://github.com/aanand/git-up/pull/41>`__
130+
131+
v0.1 (*2013-03-14*)
132+
~~~~~~~~~~~~~~~~~~
133+
134+
- Initial Release
135+
112136
.. |Build Status| image:: https://travis-ci.org/msiemens/PyGitUp.png?branch=dev
113137
:target: https://travis-ci.org/msiemens/PyGitUp

check-bundler.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Code adapted from: https://github.com/aanand/git-up/blob/master/lib/git-up.rb#L162-L181
1+
# Code adapted from: https://github.com/aanand/git-up/blob/master/lib/git-up.rb#L162-L194
22
require 'colored'
33

44
def check_bundler
@@ -11,12 +11,26 @@ def check_bundler
1111
puts
1212
print 'Gems are missing. '.yellow
1313

14-
if ARGV[0] == 'autoinstall'
15-
puts "Running `bundle install`.".yellow
16-
system "bundle", "install"
14+
if ARGV.include? 'autoinstall'
15+
if ARGV.include? 'local'
16+
puts "Running `bundle install --local`.".yellow
17+
unless system "bundle", "install", "--local"
18+
puts "Problem running `bundle install --local`. Running `bundle install` instead.".yellow
19+
system "bundle", "install"
20+
end
21+
else
22+
puts "Running `bundle install`.".yellow
23+
system "bundle", "install"
24+
end
25+
26+
if ARGV.include? 'rbenv'
27+
puts "Running `rbenv rehash`.".yellow
28+
system "rbenv", "rehash"
29+
end
1730
else
1831
puts "You should `bundle install`.".yellow
1932
end
33+
2034
end
2135
end
2236

0 commit comments

Comments
 (0)