Git Product home page Git Product logo

mdlr's Introduction

Mdlr Tool for Git Dependencies

Declarative and easy git 'submodules without the pain of submodules.'

In action

asciicast

Installing

Linux / OS X

To install for linux or OS X systems, please run curl https://s3-us-west-2.amazonaws.com/mdlr-dist/v1/install.sh | bash

Dockerfile-compatible Automated Installer (assumes *nix system, root, non-interactive)

For docker-ized installs or systems where you are in the root shell, please run curl https://s3-us-west-2.amazonaws.com/mdlr-dist/v1/install-root.sh | bash

Windows (Beta support)

Download the .exe binary for your platform:

From there, you can put the .exe file where you like and run it from the command line/powershell.

If you have any issues, with the Windows install/functionality, please report them here.

Updating

Please run the install script for your platform above to get the latest updates. For windows users, replace the .exe binary

Using Mdlr

Example workflow

  1. cd project/directory/ # Enter the project directory
  2. mdlr init
  3. mdlr add --name depname --path deps/mydep --url https://github/org/mydep.git
  4. mdlr import -f # Reset the module forcefully (wipe changes, if any) and then import it at the version in the mdlr.yml file. This is the recommended command
  5. mdlr list # List the modules
  6. mdlr status # Get the status overview
  7. mdlr update -f # Reset the module forcefully (wipe changes, if any) and then update it and write the new update to the mdlr.yml file
  8. vim mdlr.yml # View/edit the mdlr.yml file

Create a new mdlr project

In the project directory, run mdlr init

Import modules for a mdlr project

In the project directory, run mdlr import -f

Update modules for a mdlr project

In the project directory, run mdlr update -f (that's like doing git pull in each module)

Edit a module and commit it

Go into the submodule directory, make modifications, and commit them. Then go back to the project root repository, git status, then git add . and commit that change. It will commit the latest commit from the submodule.

If there are modified files in the submodule that are not committed, then it's impossible to commit it in the project root repository.

Commands overview

  • help: get a help overview
  • init: generate a mdlr.yml file in the directory
  • list: list the current modules
  • add: add a module to the mdlr.yml file
  • remove: remove a module
  • import: import a module
  • update: update a module
  • status: get the status for the mdlr.yml or invidual modules

Installing from Source / Developing

Prerequisites

  1. Ubuntu 16.04 (Server or Desktop) operating system -- other similar systems and OS X might work, but aren't guaranteed to...
  2. GoLang 1.9.^ installed
  3. GoLang dependency manager installed (Install guide)

Get the project

  1. go get github.com/exlinc/mdlr

Setting up dep

  1. cd $GOPATH/src/github.com/exlinc/mdlr
  2. dep ensure -v # Set to verbose to track the progress as this might take a while...

Build the code (for dev platform)

  1. go build # Optionally, use go run main.go instead of the build+run flow and your code will compile every time you run with the latest changes

Run the code

  1. ./mdlr # Runs the latest output of go build OR go run main.go # Compiles a temp binary from the latest changes and runs it all in one command

Install the dev binary on your system

  1. Run go install which (if your $GOPATH/bin is in your $PATH) will create a globally-accessible tools-mdlr binary that you can use to easily test a 'dev' version of your code anywhere on your dev system with tools-mdlr

Distribution

Build the distribution binaries

  1. ./xplatform-build.sh
  2. See the output binaries in the ./build directory!

Uploading to S3 for distribution

The S3 upload is done by the maintainer (EXL Inc.) for new releases to the bucket used in the install scripts.

Contributing

Contributions are welcome and appreciated in the form of issues and pull requests in this repo!

License

MIT

mdlr's People

Contributors

barbzyhool avatar cyborch avatar stanvarlamov avatar svarlamov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mdlr's Issues

Formatted mdlr.yml file

I know we are suppose to use the CLI to edit the yaml file but it sometimes it's easier just to go in with an editor and change a few things. Is it possible to configure the writer to format a little better to so we can more easily see which module we are editing.

Thanks

Allow setting git clone --depth

Git clone for deploys should run at default --depth 1 yet ensure that all dependencies are properly cloned.

Need a documented and tested way of cloning at minimal depth for deploys.

mdlr status extra flag

I feel like mdlr status should have a switch to display detailed info for all submodules at once (like running mdlr status -n module_name on each module)

mdlr status -d

and then it shows for each module:

git status
git log or git show --oneline -s or git log --pretty=oneline
remote url
maybe latest stash? dunno

Possible bug with existing subrepo

I think I found a bug, but can't really reproduce (I had it the first time I used mdlr)

I had a repository with another repo inside it but not declared as a submodule.
I did this:

mdlr init
mdlr add ...
mdlr import -f

And it seems like the import didn't overwrite or work because it was already there.

Then I retried but I first deleted the subrepository and it worked fine. I can't say more :P

Logrus format

Clean up logrus output to limit the noise in the logs (such as the [INFO] and timestamp data)

How to clone new modules alongside "old" modules?

So if you have already some modules and then you add new modules, to CLONE them you can do like this mdlr import -f (because mdlr import will fail because already existing modules if I recall) or mdlr update without the -f

Am I right?

I was used to mdlr import -f as in the README and I erased some of my unstaged changes like an idiot

Init in root dir or not to

I guess the answer is obvious but I wanted to ask:

should we mdlr init at the root or not necessarily?

What happens when we init in a subdir, and what happens if we have 2 different mdlr.yml in two different directories?

mdlr status -n module_name

  1. This command should also print this:

    INFO[0000] git show --oneline -s

  2. And the remote url etc (like mdlr status).

  3. And there is a bug:

INFO[0000] git status                                   
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
INFO[0000] On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
 

It prints the output twice

Using submodules command?

Can I use submodules command?

I did exactly like on the video, then I typed "git submodule status" but there is an error:

fatal: no submodule mapping found in .gitmodules for path `subrepo`

Questions

This looks rad.
Too bad I won't be able to help since it's in GO (why not a simple bash, or python?).

But I think I'm going to use this, I'm new to submodules but that looks like it will ease the work and I really love the "Info: git command ran". But why "INFO[00000]"?

Is it useable completely? or still in beta or something?

Also how to uninstall it?

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.