tj / git-extras Goto Github PK
View Code? Open in Web Editor NEWGIT utilities -- repo summary, repl, changelog population, author commit percentages and more
License: MIT License
GIT utilities -- repo summary, repl, changelog population, author commit percentages and more
License: MIT License
git count
shift: 3: can't shift that many
I expect most release tags are created with -a.
I found this a nice addition on this site
http://inquirylabs.com/blog2009/2008/06/12/git-info-kinda-like-svn-info/
I never used svn extensively therefore I never encountered a need to have a plugin like this, but it might be handy for people from an SVN background.
Hi TJ
Thks for the great tool
I noticed the other day that git feature finish does not check that you have committed all your changes before deleting the branch
I managed to restored the deleted branch but I think it could be useful to cancel action if not all changes have been committed
I think that would be good if you guys use DocumentUp to help on your documentation, http://documentup.com/visionmedia/git-extras
It's already looking good, if you only add this on the beginning of the README will help some people that doesn't know this tool.
Bro make a screencast!
When you want to delete an unmerged branch in Git you need to pass on the -D argument. This does not work with git-delete-branch , and the command fails on the local part (still nukes the remote branch)
If some one has configured zsh completion please provide.
Hello, can you please specify under which license this code is distributed (couldn't find any in Readme.md and mangpages)?
Thanks :)
this does not seem to be the intended behavior
bad things can happen if you're not careful :) we should show a list of descriptions etc
I just installed using brew ('brew install git-extras') but only a subset of the commands were actually installed:
$ ls -l /usr/local/Cellar/git-extras/0.0.1/bin
total 32
-r-xr-xr-x 1 mason wheel 509 Sep 13 12:06 git-changelog
-r-xr-xr-x 1 mason wheel 160 Sep 13 12:06 git-count
-r-xr-xr-x 1 mason wheel 182 Sep 13 12:06 git-ignore
-r-xr-xr-x 1 mason wheel 232 Sep 13 12:06 git-release
Perhaps the HEAD is incomplete right now? Here's the output from the installation:
$ brew install git-extras
/usr/local/bin/git
==> Cloning git://github.com/visionmedia/git-extras.git
Cloning into /Users/mason/Library/Caches/Homebrew/git-extras--git...
remote: Counting objects: 254, done.
remote: Compressing objects: 100% (119/119), done.
remote: Total 254 (delta 134), reused 240 (delta 128)
Receiving objects: 100% (254/254), 27.28 KiB, done.
Resolving deltas: 100% (134/134), done.
==> Checking out tag 0.0.1
==> make install
/usr/local/Cellar/git-extras/0.0.1: 5 files, 20K, built in 2 seconds
right now there's a bit much space, pad with gray dots
It looks like it's outputting something as there's blank lines between the top and bottom headers. Perhaps you're setting the colors in a Mac specific way? Be happy to do some debugging as this is a really useful feature,
Would it be possible to drop the git commit step from git-release? Or make it optional at the least?
It's very frustrating to try to release only to fail because there's nothing to commit, so then you need to make some nonsensical change just to be able to run the command. And TBH, why would you EVER want to release anything that hasn't been committed already? That's just asking for trouble.
I want to add a change log for my project mongoskin.
What I got from git changelog
is latest commit since last tag v0.1.1, can I generate all the change log ?
\nn.n.n / 2011-04-30 \n==================\n
* add mongoskin.router
* more document
currently if you forget $2 you will merge into master, IMO this is not ideal
I had a few merge failures when i git squashed my branch into master. I excepted it to leave the commit unmerged and let me merge and then push it myself. But in this case it just pushed broken code to the master with all the conflict markers.
It could be fixed by just checking the git merge result
Perhaps this code....
if [ $CODE -eq 0 ];then
echo "Merge Failed. Please fix it and do a git commit"
exit $CODE
fi
construct changelog from the last tag, open in $EDITOR
awk it up, --size
? i dont know
if --above is 20, 20 commits should be gray
In /README.md, The two lines
By default git ls-files is used, however you may pass one or more files to git-effort(1), for example:
$ git effort bin/* lib/*
seem to be part of git-effort doc although they appear in git-repl section
I have packaged the git-extras utilities into one deb-file and I'll make it accesible from https://edge.launchpad.net/~frandieguez/+archive/mabishu when I solve some problems with the Makefile
There are some points that needs improvement:
compute (per author?) the amount of effort (time) put in to a project. make some guesses based on first/last commit to the project each active day, or something similar to this, maybe there's a nice algo out there
It would be nice if you could filter out directories rather than just filtering by the number of commits.
Mostly I want to filter out test/* but i'm sure i'll hit other cases as well. grep would work but on a large repo the time it takes to go through a large directory you want to filter is a bit much.
to apply a pull request to a repo not created under your name (i.e. your contributing to)
Would it be possible to make Bash completion aware of git-extras, allowing for commands like git-graft to recognize available branches?
It seems to me there's no simple way to do this - but my bash_completion.d fu is weak, so perhaps there's a solution after all?
to add patterns quickly to .gitignore
feature request!
:)
If you run git ignore '*.o'
, and there are .o files in the current directory, then git-ignore will add each of those files individually to .gitignore instead of adding the wildcard. Thus, any new .o files, and any .o files in subdirectories, won't be ignored. That's the behavior we should expect without quotes around the argument, git ignore *.o
, in which case the shell does the expansion, not the script.
The installation one-liner in the README uses the http protocol which doesn't seem to work anymore:
$ curl http://github.com/visionmedia/git-extras/raw/master/bin/git-update-extras | sh
Using https instead did work though.
$ curl https://github.com/visionmedia/git-extras/raw/master/bin/git-update-extras | sh
Found this today, thought it might be a nice addition to the library.
Wherever you are in your project git root
will take you to the root directory (where .git is stored).
I'm horrible with bash scripting, so maybe someone can whip up a script, but here's an alias.
alias gr='[ ! -z
git rev-parse --show-cdup] && cd
git rev-parse --show-cdup || pwd'
Took this snippet from this article: http://www.clientcide.com/best-practices/j-or-z-for-command-line-awesomeness/
"460" is fine but not that nice, maybe had a flag, not sure which for default yet but that could easily be something nicer like "2 months" "2 years" blah blah
While working on a feature branch, I often come across and fix various minor issues (e.g. code readability). Ideally such commits should live on a separate branch to avoid obscuring feature changes.
Based on IRC conversations (#git on FreeNode), here's what I came up with (tentatively called git-flick
, for lack of inspiration):
#!/usr/bin/env bash
set -e
set -x
treeish=${1:?}
target_branch=${2:?}
git checkout "$target_branch"
git cherry-pick "$treeish"
# return to original branch
git checkout @{-1}
# remove commit from original branch
# NB: rebase shortens treeish to seven characters; rebasing from commit's parent
GIT_EDITOR="grep -v ${treeish:0:7}" git rebase -p -i "${treeish}^"
(This is not extensively tested yet.)
If this is deemed of general interest, I could submit a pull request.
An example from the Mocha Readme.md, FARKAS and Ryunosuke's names are improperly padded:
project: mocha
commits: 502
files : 86
authors:
352 Tj Holowaychuk 70.1%
98 TJ Holowaychuk 19.5%
21 Guillermo Rauch 4.2%
6 James Carr 1.2%
4 Joshua Krall 0.8%
3 Ben Lindsey 0.6%
3 Nathan Rajlich 0.6%
2 FARKAS Máté 0.4%
2 Quang Van 0.4%
1 Steve Mason 0.2%
1 Yuest Wang 0.2%
1 hokaccha 0.2%
1 David Henderson 0.2%
1 Fedor Indutny 0.2%
1 Fredrik Lindin 0.2%
1 Harry Brundage 0.2%
1 Konstantin Käfer 0.2%
1 Maciej Małecki 0.2%
1 Raynos 0.2%
1 Ryunosuke SATO 0.2%
how can i remove git-extras?
Just a note, MANPATH already has a meaning in unix shells. If a user wants to add a random directory to being search by man, they add it to MANPATH. For example, in my environment, I have $MANPATH defined to
/usr/share/man:/usr/local/share/man:/Users/wlynch/Homebrew/share/man:/opt/local/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man:/usr/X11/share/man
Because you use:
MANPATH ?= ${PREFIX}/man
the Makefile will pick up my environment variable instead of using the PREFIX style one. The fix that I used was I renamed MANPATH to MANPREFIX.
Thanks!
I have this alias on my .gitconfig
file:
[alias]
graph = log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short
it displays a nice graph with all the commits, branches names, etc:
May be useful to somebody else, since I added this alias I stopped using gitk
completely.
I have written a small scripts that archives all tracked files into a single zip archive with a useful name (e.g. git_repo_name.v0.2.3-0-g6436ae9.zip
). I need this quite often, because I work with a lot of clients who do not use git, so I thought this might be useful for other people.
Do you think this would be a nice addition to have this in git-extras? If you think this is worthy to integrate into git-extras
I will fork git-extras, figure out how to write the necessary files for man pages and and auto-completion and send you a pull request when I am done.
So let me know if you are interested in this.
Source: git-archive-file
It would be better that the command git gh-pages
removes only files committed, this will prevent a big lost of files and time of work.
Something along this path:
http://pitupepito.homelinux.org/?p=24
I use git-graft
often (which I wrote). Ironically, I always forget that it requires a second parameter. I think it would fit the git toolsuite if it defaulted to the current branch.
Current Usage:
$ git graft feature/x
# merge --no-ff's feature/x into master, then deletes feature/x
New Usage:
$ git graft feature/x
# merge --no-ff's feature/x into current branch, then deletes feature/x
And (optionally):
$ git graft feature/x develop
# merge --no-ff's feature/x into develop, then deletes feature/x
Thoughts?
Hey,
I just run the one-line installer (curl https://raw.github.com/visionmedia/git-extras/master/bin/git-extras | INSTALL=y sh) and I got this error: mkdir: /etc/bash_completion.d: Permission denied, even with sudo.
nebiros@Thurizas ~ $ sudo curl https://raw.github.com/visionmedia/git-extras/master/bin/git-extras | INSTALL=y sh
...
mkdir: /etc/bash_completion.d: Permission denied
make: *** [install] Error 1
...
FYI TJ, your one liner broke when GitHub switched their url structure:
$ curl https://github.com/visionmedia/git-extras/raw/master/bin/git-extras | INSTALL=y sh
Its works with the new structure though:
$ curl https://raw.github.com/visionmedia/git-extras/master/bin/git-extras | INSTALL=y sh
revert multi commit like git-revert.
now I use flowing steps to revert multi commit:
git reset --hard A
git reset --soft @{1} # (or ORIG_HEAD), which is D
git commit -a
hi, git changelog hangs on my system. it returns nothing nor create any files.
git changelog --list works ok, though.
best, danielzzz
Something I miss are man pages for each of the available git-extra commands. I kinda would like to check everything via the command line and not have to go to the github page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.