Archive

Posts Tagged ‘git’

Bash PS1 tricks
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

June 8th, 2011 3 comments

Many of you know already about this feature, but some of you don’t so I wanted to share it with you. I just changed mine PS1 configuration in ~/.bashrc to look like this:

export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export PS1='\[\033[1;37m\][\[\033[1;32m\]\u\[\033[0m\]@\h\[\033[0m\] $? \[\033[1;34m\]\w\[\033[0;35m\]$(__git_ps1 " %s")\[\033[1;37m\]]\[\033[0m\] '

Take a look at the following picture to see how it works:

or check the video on youtube.

The number between user@host and the current working directory is the exit status of the most recently executed command (or pipeline). This is great because you don’t have to type echo $? everytime you want to find it out. The __git_ps1 magic will print git branch name if you are inside of the git repository. Furthermore it will add special characters indicating the state of the repo: % – untracked files present, + – new files added, * – some tracked files changed, $ – there is something in the stash (see git stash --help). Pretty cool, right?

Prototype Git backend for openSUSE BuildService
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

April 22nd, 2009 No comments

GSoC logo 2009

I’m happy to announce that this year I’ll be mentoring GSoC project which will attempt to create an alternative source backend using git. Student implementing the idea is Peter Libič. I have created an openSUSE wiki page with the copy of the proposal and some useful links. Some of my colleagues (like Andreas Gruenbacher and Brandon Philips) are also interested in topic and already provided a valuable feedback. If you’d like to get involved, feel free to contact me, edit the project wiki page or join us on IRC channel #obs-git@irc.freenode.net.

Scout project introduction
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

May 16th, 2008 2 comments

You might have heard about my older project called command-not-found. Right now it is implemented as SQLite database which contains only table(binary, path, package). (I’m going to rewrite it, so that it makes use of the new SAT solver files, but this is not the topic of this blogpost).

In the meantime, my colleague and Java packager Michal Vyskocil encountered a problem: it is very hard to find out which package installs particular Java class. Standa Brabec suggested that we could also process autoconf macros stored in m4 files. So we decided to merge these ideas together and we started the “Scout” project.

It will be a command line utility which will index various attributes of the packages and will allow the users to search in them. Each functionality will have its own module, so implementation could differ (we wanted the binary module to use SAT solver files and the others SQlite). I think that you’ll get the idea from the following picture:

Michal and I started development by creating a GIT repository (not much to see there, yet). Obviously this program will not appear in openSUSE 11.0, but we’d like to see it in 11.1 (and my plan is that command-not-found will use scout as its helper). At start, we will create 3 modules (binaries, java and autoconf), but later we’ll extend the support for python/ruby programmers.

If you have any ideas, do not hesitate and contact me! :)

Tags: , , ,