Comments (11)
Going to take a look at this tonight
from homeshick.
This should do the trick. I did some half-assed version grepping as if I committed mid-code or something.
from homeshick.
I believe this change introduced a new error if the user has hub installed/aliased.
$ homeshick check
error could not determine git version
$ git --version | cut -d ' ' -f 3
1.8.2
1.10.6
$ git --version
git version 1.8.2
hub version 1.10.6
Perhaps it just needs a head -n1
in the pipeline?
from homeshick.
hah, oh wow. I didn't think of that one :-)
the head -n1
is just a patch, I think I need to find a git plumbing command for this.
from homeshick.
Hold on, isn't this because you have aliased hub
as git
?!
I couldn't help but think that adding the version number of an extension to the extended program is bad practice and from what I can tell, hub doesn't extend git in any way.
from homeshick.
@andsens yes, hub is specifically designed to "wrap" git to extend it's functionality, and most installations recommend aliasing it in that way (in fact, oh-my-zsh automatically does that, Github's boxen program automatically does it, etc). see http://defunkt.io/hub/ and that's how it's recommended to be used
I agree wrapping the --version
output like that is a bit weird... but that's what they've done for whatever reason.
from homeshick.
Hm ok. I think we go at it with grep though (so a bit like before the fix)
git_version=$(git --version | grep 'git version' | grep -oE '([0-9]+\.){3}([0-9]+)?')
Like this?
from homeshick.
Hmm.. that regex doesn't seem to match on vanilla git 1.8.2, since it expects each digit to end in a period (e.g. it matches 1.8.2.
but not 1.8.2
). My regex fu isn't quite up to knowing what would fix that most simply...
What about git --version | grep 'git version' | cut -d' ' -f3
? That should find the git version line no matter what order it appears in and then just grab the version column despite what characters it contains (which would be good if there ever exists version numbers such as 1.8.3a
-- not sure if that is likely or not.)
BTW, it looks like the line which may also really have to be modified is not the shell capture itself but the following line
if [[ ! $GIT_VERSION =~ ([0-9]\.){3}[0-9] ]]; then
becauseI believe it has that same problem with requiring three .
s when a three-arg version number only has two.
from homeshick.
which would be good if there ever exists version numbers such as 1.8.3a -- not sure if that is likely or not
Trouble is, then version_compare won't work anyways... So this check is really only to make sure users don't get a weird error in the middle of the script.
from homeshick.
This should do it.
from homeshick.
Seems to be working here, thanks!
from homeshick.
Related Issues (20)
- homeshick `cd` command doesn't work on Homebrew install HOT 1
- New version? HOT 4
- Homeshick gives a help message and crashes my zsh session HOT 1
- Don't commit home folder HOT 1
- Dependancy Issue with ASDF HOT 5
- Add dry run mode HOT 2
- Homeshick doesnt prompt me upon refresh HOT 1
- Clone command should use git@github as the remote origin HOT 4
- Always says my castles are outdated no matter I just refreshed HOT 5
- Cloning takes forever for simple repos HOT 1
- Automatically symlink submodules of castle as a single symlink to toplevel directory HOT 4
- homeshick doesn't track nor link .git directories HOT 6
- Your package destroyed all of my dotfiles HOT 13
- 解决zsh补全msfvenom出现_values:compvalues:11: not enough arguments(参数不足)的问题 HOT 2
- Clone/pull on large repositories/submodules: Recursion and depth HOT 2
- New version? HOT 1
- Clone to directory, and set working directory, like git -C directory HOT 2
- Relative symlinks do not allow git templatedir to live in castle HOT 3
- Naming differences HOT 4
- Installing homeschick broke the terminal HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeshick.