From mboxrd@z Thu Jan 1 00:00:00 1970 From: jugg at hotmail.com (chris) Date: Fri, 10 Jun 2011 06:42:51 +0000 (UTC) Subject: [PATCH] guess default branch from HEAD References: <20110407104958.GB1004@plenz.com> <1302173964-12520-1-git-send-email-plenz@cis.fu-berlin.de> Message-ID: Julius Plenz writes: > > This is a saner alternative than hardcoding the default branch to be > "master". The add_repo() function will now check for a symbolic ref in > repo_path/HEAD. If there is a suitable one, overwrite repo->defbranch > with it. Note that you'll need to strip the newline from the file (-> > len-17). > > If HEAD is a symbolic link pointing directly to a branch below > refs/heads/, do a readlink() instead to find the ref name. > > Signed-off-by: Julius Plenz I've successfully applied this patch against the current stable branch (commit: 2a8f5531) and deployed the resulting binary without trouble. The functionality appears to work as advertised. So, along with setting the default 'readme' value as: readme=HEAD:README.md each project is able to have a sensible default presentation based off of the project's default branch. Very useful as we use gitolite to manage our repositories, this saves us further manual configuration outside of gitolite. I hope this patch can be integrated into the official release. chris