Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyibo committed Feb 14, 2024
0 parents commit 9d7b114
Show file tree
Hide file tree
Showing 6 changed files with 1,514 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
198 changes: 198 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

*.swp
*.swo
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 liuyibo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
152 changes: 152 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# 🐒 ExpMonkey: Unleash Your Experiments with Git Magic! 🍌

Welcome to ExpMonkey, the nimble experiment management tool that transforms the way you handle your research and development projects. By harnessing the power of git worktrees, ExpMonkey offers a command-line sanctuary for your branches, treating each one as a unique adventure in the jungle of innovation. Ready to swing from experiment to experiment with the grace of a seasoned primate? 🌿 Let's dive in!

## 🌟 Spotlight Features

Embark on a journey with ExpMonkey and discover a world where managing multiple experiments feels like a walk in the park:

- 🍌 **Parallel Universe Workflow**: Each git branch becomes an alternate reality, with its own directory to tinker in. Work on multiple fronts without ever tangling your vines.

- 🍌 **Jungle Gym Navigation**: Leap between branches with a simple command. It's like having a map of the entire jungle at your fingertips.

- 🍌 **Git Sorcery Enhanced**: ExpMonkey casts a spell on the standard git rituals, streamlining branch antics and conjuring up tools specifically for the experimental alchemist.

- 🍌 **Branch Alchemy**: Transmute, clone, and compare experiments with the dexterity of a monkey's tail, all thanks to ExpMonkey's clever branch wizardry.

- 🍌 **Chant Autocompletion**: Invoke the spirits of speed and precision with our autocompletion incantations, banishing typos to the shadow realm.

- 🍌 **Fuzzy Oracle Integration**: Consult the `fzf` oracle for visions of branches and commits, selecting your path with the clarity of a shaman's trance.

## 📜 Prerequisites

Before you embark on this quest, ensure you have the following relics:

- Python 3.x
- Git
- Optional: `fzf` for an enhanced soothsaying interface

## 🛠 Installation: Summoning ExpMonkey

Invoke ExpMonkey into your realm with these ancient incantations:

1. Conjure the Python package:
```shell
pip3 install expmonkey
```

2. (Optional) Weave `em-init-script` into your shell's tapestry for autocompletion and arcane abilities:
```bash
echo 'source <(em-init-script)' >> ~/.bashrc
```

3. (Optional) Summon `fzf` for a mystical user experience:
``` bash
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
```
Consult the [fzf grimoire](https://github.com/junegunn/fzf#installation) for more details.

## 📗 Grimoire of Usage

Harness the power of ExpMonkey as you navigate the treacherous terrain of experiments:

### 🌱 Sprout a New Repository
```bash
em clone [email protected]:megvii-research/RevCol.git
```

### 📜 Parchment of Experiments
```bash
em ls -as
```

### 🌿 Branch Out with Forks
```bash
em cp <base-branch-name> <new-branch-name>
```

### 🚀 Propel Your New Creation
```bash
em cd <new-branch-name>
# Enchant with your changes
em push
```

## 🧙‍♂️ Command Incantations

### The Dot Trick 🐒🐒🐒
ExpMonkey's eyes gleam when spotting a `.`. Behold the magic:

### 🕳️ Conjure from the Void
Create an empty experiment:
``` shell
em empty <branch-name>
```

### 🔍 Scrying List
Peer into the branches:
``` shell
em ls # unveil local branches
em ls <filter-regex> # filter through local branches
em ls -as # reveal remote branches with status
```

`em ls -as` illuminates branches with enchanted hues:

| Color | Meaning |
| ---- | ---- |
| Red | Distant Lands (Remote) |
| White | Uncharted (Not Checked out) |
| Blue | Whispering Winds (Not Pushed) |
| Yellow | Altered Realms (Modified) |
| Normal | Harmony (Clean) |

`em ls` is a swift spell, while `em ls -as` consults distant spirits, requiring more time.

### 🌟 Starry Copy
Craft a new branch from existing strands of fate:
``` shell
em cp <Tab> <target-branch-name> # divine local branches
em cp .r<Tab> <target-branch-name> # divine all branches
em cp <base-branch-name> .<Tab> # scribe as base-branch-name
em cp .<Tab> <target-branch-name> # scribe as current-branch-name
em cp . <target-branch-name> # duplicate current branch
```

### 🌀 Portal to Another Branch
Step into another experiment:
``` shell
em co <Tab> # divine local branches
em co .r<Tab> # divine all branches
em co <branch-name> # step through the portal
```

### 🗑️ Banish an Experiment
Cast away an unwanted branch:
``` shell
em rm <branch-name> # banish branch
em rm . # banish current branch
```

### 🌌 Push to the Cosmos
Send your experiment into the vast unknown:
``` shell
em push # launch it skyward
```

### 📛 Rename Your Destiny
Alter the name of your journey:
``` shell
em mv <current-branch-name> <target-branch-name>
```

### 🔮 Gaze into Differences
Witness the divergence between realms:
``` shell
em diff <branch1> <branch2>
```

## 📜 License

This project is a tome of knowledge, open to all seekers under the [MIT License](LICENSE).
Loading

0 comments on commit 9d7b114

Please sign in to comment.