Necoro’s Blog

Blog? Blog? There is no blog…

Posts Tagged ‘git

Managing your configuration files with Git and StGit. Revisited #2

leave a comment »

Ok … I wrote about using Git and StGit and about how I ditched StGit and used plain Git. So – just a short update: I reverted back to using StGit :D. I updated the two mentioned posts.

Oh – and for my convenience, I wrote a “small” function in zsh which does the “pop, commit, push, push” cycle needed if you want to have a patch applied directly in Git and not in StGit. You can find it here (function “cci”) … or below.

cci ()
    if [[ $# == 0 ]]; then
        echo "No message given. Aborting."
        return 1

    local message=$1
    local tok=__cci__

    pushd -q ~

    cstg diff
    echo -n "Is this ok? [y/n] "
    if ! read -q; then
        echo "I would have done the wrong thing ... aborting!"
        return 2

    echo ">> Creating new patch"
    cstg new $tok -m "$message"
    echo ">> Refreshing"
    cstg refresh

    if [[ -z $(cstg files) ]]; then
        echo "Ehm - this patch is empty. Narf. Aborting!"
        echo "Deleting useless patch"
        cstg del $tok
        return 3

    echo ">> Committing"
    cstg commit $tok
    if [[ -n $(cstg series --applied) ]]; then
        echo "Urgs! Something went wrong. There are still patches applied."
        echo "Clean up for yourself. Aborting here!"
        return 4
    echo ">> Pushing to remote"
    config push

    echo ">> Re-apply patches"
    cstg push -a

    echo ">> Done"

    popd -q

Written by Necoro

March 27, 2010 at 15:28

Portato moving to Git – Part II

leave a comment »

I now found some time to finalize the move from bzr to git. Hence now it can be considered official and the old bazaar branches are deprecated.

You can find the portato code and the overlay at github:

As Launchpad offers a git-import service (which is quite nice), the master branch is mirrored there and can still be accessed via lp:portato using bzr.

I announced in the following places … hopefully I haven’t forgotten an important one:

  • Both threads in the Gentoo forums.
  • Launchpad page.
  • Origo Development Page.

Written by Necoro

October 24, 2009 at 00:19

Posted in Portato

Tagged with , ,

Managing your configuration files with Git. Revisited.

leave a comment »

I showed a way of managing the configuration files with git and StGit in the post two days ago. But this has two disadvantages:

  1. StGit is not installed on all systems. And though it is only some Python-Code which is not hard to install in your home directory, it is something I’d like to avoid.
  2. Using two commands (config and cstg) is not the best thing. Having only one command would be better…

So I tried the more natural way (often I tend to think way too complex) of using git branches. I created a “local” branch, which is used for the local changes (hah – you could not guess it :P). And then I only use rebasing to pull global changes.

Update: In the meantime I switched back to using stgit … it just worked somewhat better. But the approach mentioned here still works pretty good :)

Compared to the older method, the approach is now:

  1. Same as the old one.
  2. Create local branch and use it:
    config checkout -b local
    # hack hack hack
    config commit -a
    # ...
  3. Change to master and work there
    config checkout master
    # make changes
    config commit -a
    config push
    config checkout local
    config rebase master
  4. Same (except step 7 of course).

Written by Necoro

October 10, 2009 at 02:26

Managing your configuration files with Git and StGit

with one comment

This is propably a wide known problem: You want your personal config files (for ViM, Emacs, $SHELL, …) on all the boxes you have to deal with. The solution here is often: Use some distributed VCS/SCM like git, bzr, hg, whatever and be happy. But it might happen (and it will surely happen quite often), that the boxes have different versions installed for some packages. Or there are other differences (for example: I have to use other font sizes on my laptop than on my PC). This not a problem, if the config files you are using allow importing other ones — you have your global options and override them with some local additions. Well, unfortunately, this is not always supported (e.g. I do not know of a way to import something into .gitconfig). So we have to find a solution…

And I guess, I found one: Use Git to manage the global stuff — and use StGit to manage a stack of patches for the local boxes :)

Read the rest of this entry »

Written by Necoro

October 8, 2009 at 01:52

Portato moving to git — Part I

leave a comment »

So — as announced in my previous post, I started moving to git. You can find the current git repository at Github:

Note: This move is not yet “official”. I have to test first, if I get completely used with git. And then I have to find a hosting platform (github was chosen, because I have an account there already) :). Or perhaps, I am going to host it myself … dunno.

Written by Necoro

October 5, 2009 at 20:34

Posted in Portato

Tagged with ,

Bzr vs Git

with one comment

I had to deal with git yesterday, as I worked on ktsuss. And as always: I couldn’t make it to do what I wanted it to do ;). Thus I head to read the docs … and believe it or not: I’ve been always a contra-Git-guy, but when you get rid of the “it must be similar to all the other SCMs”-thought, git’s concepts begin to make sense. So I spent even more time with reading docs and playing around. And currently it seems, like I am going to replace bzr by git sometime in the future.


  • way faster
  • branches inside the one repository file — no more ‘gnah — the branch is still on my laptop’
  • allows to finally get the currently split svn history back in (though using ugly hacks … but hey — git is all about ugliness :P)
  • git is better supported by most tools — bzr plays only a small role (unfortunately)

I just need to find another bugtracker then, as I planned to use the launchpad one, which does not make sense anymore.

A last remark: I still think, that bzr is a GREAT scm :).

Written by Necoro

October 5, 2009 at 17:53

Posted in Portato

Tagged with , ,