wkhere / uproot

tiny C prog to find the toplevel git or syncthing dir you're in

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This tiny program prints full path of the toplevel git / syncthing directory
you're in, or exits(1) if you're not inside one.

Usage: `uproot git` or `uproot st`.

Note: this program was called `gitroot` before and was limited to git only,
thus it's providing a oneliner `gitroot` script for compatibility.


What else...
It is intended to be run thousands of times within various scripts,
thus the C version, consuming the least amount of resources possible.

By the way, invoking 'uproot git' is a shorter and quicker equivalent
of running the following vanilla git subcommand:

`git rev-parse --show-toplevel`

(vanilla syncthing does not have an equivalent).


Licensed under FreeBSD 3-clause license.

About

tiny C prog to find the toplevel git or syncthing dir you're in

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C 81.9%Language:Makefile 16.1%Language:Shell 2.0%