Skip to content
/ daun Public

Expand your git branches and tags as directories

License

Notifications You must be signed in to change notification settings

ceilfors/daun

Repository files navigation

Gem Version ![Build Status](https://img.shields.io/circleci/project/ceilfors/daun/master.svg?label=Build Status) Code Climate Test Coverage

Daun

Daun is a CLI program that will expand git branches and tags to your disk as directories. Daun will keep the expanded directories in sync whenever there are new, updated, or deleted tags and branches.

Daun is originally designed to help index your source code in OpenGrok.

Installation

$ gem install daun

Daun uses rugged gem to talk to git repositories. As of today, this gem can be problematic to be installed in OS other than Linux hence it has been made an optional dependency. Because of this, you have to be able to install rugged gem manually first before installing daun. Visit rugged documentation if you have problem installing rugged. If you are using chef, consider checking cookbook-daun recipe out which will help you install daun/rugged smoothly.

Usage

$ daun init [GIT_CLONE_URL] daun-repo
$ cd daun-repo
$ daun checkout

or

$ daun init [GIT_CLONE_URL] daun-repo
$ daun checkout --directory daun-repo

Subsequent calls to checkout will update your daun-repo directory with the latest branches and tags:

  • Newly created branches and tags will be added in daun-repo
  • Updated branches and tags will be updated in daun-repo
  • Deleted branches and tags will be deleted in daun-repo

The resulting output of the commands above will look like this in your disk:

daun-repo/
    .git/
    branches/
        master/
        feature/foo/
    tags/
        v1.0.0/

Options

Daun options are stored as git config. Hence you will be able to configure your daun-repo just like any git repositories e.g. executing git config in your daun-repo directory or even by setting the global or system git configuration. Visit git config official documentation for more information.

The following options are available in daun:

Name Description Default Example
daun.branch.blacklist Branches that match the pattern set in this option will not be checked out by daun. Multiple patterns are supported by space character. Pattern is matched by using File.fnmatch? method. Daun will by default check out all branches. The example given will blacklist any branches that have hotfix/ or release/ prefix. "" "hotfix/* release/*"
daun.tag.blacklist Tags that match the pattern set in this option will not be checked out by daun. Multiple patterns are supported by space character. Pattern is matched by using File.fnmatch? method. Daun will by default check out all tags. The example given will blacklist any tags that have staged/ or build/ prefix. "" "staged/* build/*"
daun.tag.limit This option limits the number of tags being checked out by daun. Daun will always keep the latest tags e.g. ordered by date. Daun will by default check out all tags without any limit. With the example given, daun will only check out the latest 5 tags and ignore the older ones. You can also set this value to 0 if you don't want to check out any tags at all. -1 (unlimited) 5

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ceilfors/daun. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

About

Expand your git branches and tags as directories

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages