Giter VIP home page Giter VIP logo

git-global's Introduction

git-global

Crates.io Crates.io

Use git-global to keep track of all your git repositories.

This is a Rust program that you can put on your PATH with cargo install git-global, gaining an extra git subcommand that you can run from anywhere. To obtain cargo and Rust, see https://rustup.rs.

Use git global <subcommand> to:

  • git global [status]: show git status -s for all your git repos (the default subcommand)
  • git global info: show information about git-global itself (configuration, number of known repos, etc.)
  • git global list: show all git repos git-global knows about
  • git global scan: search your filesystem for git repos and update cache

Configuration

To change the behavior of git-global, you can do so with --- wait for it --- git global configuration!

To set the base path for search to something other than your home directory:

git config --global global.basedir /some/path

To add patterns to exclude while walking directories:

git config --global global.ignore .cargo,.vim,Library

TODO

  • filter tag-projects by path, status, prepopulate a list of potential new tags
  • Option to strip all tags
  • Better message suggesting "use list or status"
  • Filter list
    • by regex
    • by tag
    • showing coloured text output
  • Some tests?
  • Some assertions
  • reconcile add_tags and tag_projects_redo
  • have a negative filter option for status also (things to exclude)
  • Replace mpsc with crossbeam in status command

Rust 2018

  • extern crates
  • try to get rid of some unwraps for ?s

Bugs

  • What if we scan for repos again - do we lose all our existing tag info?
    • Should have an "update repos" scan by default that will keep existing tags info...
    • We need to store tags separately maybe?
  • When we tag-projects after filtering by path/tag and save them we are overwriting our repos with a subset of all our repos

Bigger Changes

  • Maybe i need to refactor the basic data types - they probably dont make sense for what i want this project to be
    • particularly GitGlobalConfig and GitGlobalResult
      • GitGlobalConfig reads .gitglobalconfig and stores option
        • it is used to read/save repos to the cache
      • GitGlobalResult stores a bunch of "messages" for each Repo and in general for the result of an operation
    • What would fit instead?
      • Need to persist more data
      • Initial resource should fetch and store our global repo/tag list
        • When we try to save a subset of repos we should update this list/merge the two and then save
      • So we should perhaps store
        • default tags
        • current tags
        • baseline/cached repos
        • subset of total repos
        • baseline/cached/default actions
        • newer actions
  • Get rid of duplicated core functionality

Actions

  • An option to run an action on groups of repos/directories
  • A whitelist or blacklist of commands
    • i.e. dont run rm or mv without a prompt
  • A dangerous flag?
  • Perhaps a more complex input format/source than a comma separated list of strings
  • A GUI composer - let you see what Repos you would be about to effect with an action based on path/tag filtering.
  • A way to sequence actions run one then another
  • [ ]

Ideas

  • git global unstaged: show all repos that have unstaged changes

  • git global staged: show all repos that have staged changes

  • git global stashed: show all repos that have stashed changes

  • git global dirty: show all repos that have changes of any kind

  • git global branched: show all repos not on master (TODO: or a different default branch in .gitconfig)

  • git global duplicates: show repos that are checked out to multiple places

  • git global remotes: show all remotes (TODO: why? maybe filter by hostname?)

  • git global add <path>: add a git repo to the cache that would not be found in a scan

  • git global ignore <path>: ignore a git repo and remove it from the cache

  • git global ignored: show which git repos are currently being ignored

  • git global monitor: launch a daemon to watch git dirs with inotify

  • git global pull: pull down changes from default tracking branch for clean repos

  • stream results as the come in (from git global status, for example, so we don't have to wait until they're all collected)

  • use locate .git if the DB is populated, instead of walking everything

  • make a Subcommand trait

  • do concurrency generically, not just for status subcommand

  • rename GitGlobalResult so it's not confused with a normal Result

Release Notes

  • 0.1.1 (work-in-progress)
    • add tests
    • expand documentation and package metadata
    • update dependency versions
  • 0.1.0 (1/31/17)
    • initial release with the following subcommands: help, info, list, scan, status

git-global's People

Contributors

halhenke avatar peap avatar

Stargazers

Roman avatar Andrew Johnson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.