Today’s random tech tip of the day – how to check whether you have modifications in a bunch of different locally cloned git repos:
⯠for x in *; do echo $x ; ( cd $x; git status -s ); done contentsvc jobsvc M supervisor.conf profilesvc
Today’s random tech tip of the day – how to check whether you have modifications in a bunch of different locally cloned git repos:
⯠for x in *; do echo $x ; ( cd $x; git status -s ); done contentsvc jobsvc M supervisor.conf profilesvc
I have sometimes had a git branch called “tests” because I was adding tests or working on tests. The problem is that many projects have a “tests” directory so if you have a “test” branch, you get this:
$ git diff tests fatal: ambiguous argument 'tests': both revision and filename Use '--' to separate paths from revisions, like this: 'git[ ...] -- [ ...]'
You can of course use git diff -- tests
and it will work, but it’s easier to just not name a branch “tests” in the first place.
I was dying a slow death from the slowness of my zsh prompt when using oh-my-zsh‘s git plugin and a repository managed by git-svn. I finally decided to do something about it today.
I tracked the slowness down to the parse_git_dirty
function in oh-my-zsh/lib/git.zsh
. This function calls git status
which seems to be quite slow in my environment. My fix was to replace the oh-my-zsh version of the git_prompt_info
function with a version that doesn’t call parse_git_dirty
. This means that I can’t get the little checkmark (“✔”) or “X” (well actually “✗”) that shows whether my working copy is dirty or not, but it’s worth it to me to not have my prompt lag like crazy.
To fix this, I pasted the following into my ~/.zshrc
:
gitpoller
accepted into BuildbotI use Buildbot for a (Django) project at work. When we switched from svn to git, I had problems getting Buildbot to pull down the code from our private GitHub repo. Rather, I was getting this error:
Failure: twisted.internet.utils._UnexpectedErrorOutput: got stderr: "fatal: ambiguous argument 'master..origin/master': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\n"
It turned out that the problem was that the git subprocesses weren’t inheriting my environment which has SSH_AGENT_PID
and SSH_AUTH_SOCK
environment variables to make ssh to GitHub work.
The effect of the patch is that when calling external git commands, the environment is passed so that crucial environment variables like SSH_AGENT_PID
and SSH_AUTH_SOCK
get propagated. Otherwise, Buildbot will not be able to make use of ssh keys with passphrases that are cached by ssh-agent
.