<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tribulaciones.org &#187; prompt</title>
	<atom:link href="http://tribulaciones.org/tag/prompt/feed/" rel="self" type="application/rss+xml" />
	<link>http://tribulaciones.org</link>
	<description>A blog about me and whatever insterests me</description>
	<lastBuildDate>Wed, 27 Jan 2010 22:12:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>git tips</title>
		<link>http://tribulaciones.org/2008/12/git-tips/</link>
		<comments>http://tribulaciones.org/2008/12/git-tips/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 20:56:03 +0000</pubDate>
		<dc:creator>jsogo</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[utilities]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[PS1]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://tribulaciones.org/?p=64</guid>
		<description><![CDATA[Git is becoming my main utility for Debian packaging, as I am using it to keep my work on packages I maintain alone or in a team by using git.debian.org facilities. I am not still using tools like TopGit to keep patches, by I also intend to do so in a near future.
What does git [...]]]></description>
			<content:encoded><![CDATA[<p>Git is becoming my main utility for Debian packaging, as I am using it to keep my work on packages I maintain alone or in a team by using <a onclick="javascript:pageTracker._trackPageview('/outbound/article/git.debian.org');" href="http://git.debian.org/">git.debian.org</a> facilities. I am not still using tools like TopGit to keep patches, by I also intend to do so in a near future.</p>
<p>What does git give me over svn? Basically two things: branches and having the whole source code at hand. The first is obvious, I can easily create branches to <em>experiment </em>without having to change anything in the way the package is, so if a new upstream release occurs in the time it takes me to implement some change (and that usually happens) I can upload it straight, not affecting my undergoing changes.</p>
<p>Also I appreciate having the whole source code. This could have been also done using svn, but we preferred not to do so, and most packages only have <strong>debian dir </strong>in their svn repositories. This makes harder work with upstream sources, where they need to be patched. Git provides me the way to have always an upstream source code copy at hand, and the branch power can also be applied to it.</p>
<p>But I wanted to write about a couple of git tips that I found. Seems that they have already appeared on Planet Debian before, but I think that is not a bad idea to remember them (from <a onclick="javascript:pageTracker._trackPageview('/outbound/article/log.damog.net');" href="http://log.damog.net/2008/12/two-git-tips/">damog’s blog</a>):</p>
<p style="padding-left: 30px;"><strong>1. </strong>Changing into a directory that contains a repo and shows you on PS1 what branch you are standing on:</p>
<p style="padding-left: 30px;">On .bashrc I have:</p>
<p style="padding-left: 60px;"><code>GITPS1='$(__git_ps1 ":%s ")'</code></p>
<p>export PS1=&#8221;${GREEN}\w${RS} ${YELLOW}${GITPS1}${RS}\\$ &#8221;</p>
<p style="padding-left: 30px;">But what I didn’t want to lose was the code that was posted to paste.bin after in a comment someone pointed out that this trick was a bit annoying if your home dir were also a git repo. This is one solution:</p>
<p style="padding-left: 60px;"><code>__maybe_git_ps1 () {</code></p>
<p>local BRANCH=&#8221;$(__git_ps1 &#8216;%s&#8217;)&#8221;</p>
<p>case &#8220;$BRANCH&#8221; in</p>
<p>master)</p>
<p># silent</p>
<p>;;</p>
<p>&#8221;)</p>
<p># not a git repo? -&gt; silent</p>
<p>;;</p>
<p>*)</p>
<p>if [ -n "$1" ]; then</p>
<p>printf “$1″ “$BRANCH”</p>
<p>else</p>
<p>printf ” (%s)” “$BRANCH”</p>
<p>fi</p>
<p>;;</p>
<p>esac</p>
<p>}</p>
<p style="padding-left: 60px;">
<p style="padding-left: 30px;"><strong>2. </strong>An alias I like to use on repos that are personal for quick tracking:</p>
<p style="padding-left: 60px;"><code>[alias]</code></p>
<p>…</p>
<p>log1 = log –pretty=oneline –abbrev-commit</p>
<p>Thanks damog for these tips!</p>
]]></content:encoded>
			<wfw:commentRss>http://tribulaciones.org/2008/12/git-tips/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
