oh my
This commit is contained in:
parent
99f8e31f96
commit
1b28ec5ec1
1176 changed files with 6 additions and 111234 deletions
6
.chezmoiexternal.toml
Normal file
6
.chezmoiexternal.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[".oh-my-zsh"]
|
||||||
|
type = "archive"
|
||||||
|
url = "https://github.com/ohmyzsh/ohmyzsh/archive/master.tar.gz"
|
||||||
|
exact = true
|
||||||
|
stripComponents = 1
|
||||||
|
refreshPeriod = "168h"
|
|
@ -1,76 +0,0 @@
|
||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
|
||||||
contributors and maintainers pledge to making participation in our project and
|
|
||||||
our community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
||||||
level of experience, education, socio-economic status, nationality, personal
|
|
||||||
appearance, race, religion, or sexual identity and orientation.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
|
||||||
include:
|
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
|
||||||
* Being respectful of differing viewpoints and experiences
|
|
||||||
* Gracefully accepting constructive criticism
|
|
||||||
* Focusing on what is best for the community
|
|
||||||
* Showing empathy towards other community members
|
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
||||||
advances
|
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or electronic
|
|
||||||
address, without explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Our Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable
|
|
||||||
behavior and are expected to take appropriate and fair corrective action in
|
|
||||||
response to any instances of unacceptable behavior.
|
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or
|
|
||||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
||||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
||||||
permanently any contributor for other behaviors that they deem inappropriate,
|
|
||||||
threatening, offensive, or harmful.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies within all project spaces, and it also applies when
|
|
||||||
an individual is representing the project or its community in public spaces.
|
|
||||||
Examples of representing a project or community include using an official
|
|
||||||
project e-mail address, posting via an official social media account, or acting
|
|
||||||
as an appointed representative at an online or offline event. Representation of
|
|
||||||
a project may be further defined and clarified by project maintainers.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported by contacting the project team at ohmyzsh@planetargon.com. All
|
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
||||||
Further details of specific enforcement policies may be posted separately.
|
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
||||||
faith may face temporary or permanent repercussions as determined by other
|
|
||||||
members of the project's leadership.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
||||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see
|
|
||||||
https://www.contributor-covenant.org/faq
|
|
|
@ -1,245 +0,0 @@
|
||||||
# CONTRIBUTING GUIDELINES
|
|
||||||
|
|
||||||
Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged, and appreciated.
|
|
||||||
It is also essential for the development of the project.
|
|
||||||
|
|
||||||
First, please take a moment to review our [code of conduct](CODE_OF_CONDUCT.md).
|
|
||||||
|
|
||||||
These guidelines are an attempt at better addressing the huge amount of pending
|
|
||||||
issues and pull requests. Please read them closely.
|
|
||||||
|
|
||||||
Foremost, be so kind as to [search](#use-the-search-luke). This ensures any contribution
|
|
||||||
you would make is not already covered.
|
|
||||||
|
|
||||||
<!-- TOC updateonsave:true depthfrom:2 -->
|
|
||||||
|
|
||||||
- [Reporting Issues](#reporting-issues)
|
|
||||||
- [You have a problem](#you-have-a-problem)
|
|
||||||
- [You have a suggestion](#you-have-a-suggestion)
|
|
||||||
- [Submitting Pull Requests](#submitting-pull-requests)
|
|
||||||
- [Getting started](#getting-started)
|
|
||||||
- [You have a solution](#you-have-a-solution)
|
|
||||||
- [You have an addition](#you-have-an-addition)
|
|
||||||
- [Use the Search, Luke](#use-the-search-luke)
|
|
||||||
- [Commit Guidelines](#commit-guidelines)
|
|
||||||
- [Format](#format)
|
|
||||||
- [Style](#style)
|
|
||||||
- [Volunteer](#volunteer)
|
|
||||||
|
|
||||||
<!-- /TOC -->
|
|
||||||
|
|
||||||
## Reporting Issues
|
|
||||||
|
|
||||||
### You have a problem
|
|
||||||
|
|
||||||
Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
|
|
||||||
your problem.
|
|
||||||
|
|
||||||
If you find one, comment on it, so we know more people are experiencing it.
|
|
||||||
|
|
||||||
If not, look at the [Troubleshooting](https://github.com/ohmyzsh/ohmyzsh/wiki/Troubleshooting)
|
|
||||||
page for instructions on how to gather data to better debug your problem.
|
|
||||||
|
|
||||||
Then, you can go ahead and create an issue with as much detail as you can provide.
|
|
||||||
It should include the data gathered as indicated above, along with the following:
|
|
||||||
|
|
||||||
1. How to reproduce the problem
|
|
||||||
2. What the correct behavior should be
|
|
||||||
3. What the actual behavior is
|
|
||||||
|
|
||||||
Please copy to anyone relevant (e.g. plugin maintainers) by mentioning their GitHub handle
|
|
||||||
(starting with `@`) in your message.
|
|
||||||
|
|
||||||
We will do our very best to help you.
|
|
||||||
|
|
||||||
### You have a suggestion
|
|
||||||
|
|
||||||
Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
|
|
||||||
your suggestion.
|
|
||||||
|
|
||||||
If you find one, comment on it, so we know more people are supporting it.
|
|
||||||
|
|
||||||
If not, you can go ahead and create an issue. Please copy to anyone relevant (e.g. plugin
|
|
||||||
maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
|
|
||||||
|
|
||||||
## Submitting Pull Requests
|
|
||||||
|
|
||||||
### Getting started
|
|
||||||
|
|
||||||
You should be familiar with the basics of
|
|
||||||
[contributing on GitHub](https://help.github.com/articles/using-pull-requests) and have a fork
|
|
||||||
[properly set up](https://github.com/ohmyzsh/ohmyzsh/wiki/Contribution-Technical-Practices).
|
|
||||||
|
|
||||||
You MUST always create PRs with _a dedicated branch_ based on the latest upstream tree.
|
|
||||||
|
|
||||||
If you create your own PR, please make sure you do it right. Also be so kind as to reference
|
|
||||||
any issue that would be solved in the PR description body,
|
|
||||||
[for instance](https://help.github.com/articles/closing-issues-via-commit-messages/)
|
|
||||||
_"Fixes #XXXX"_ for issue number XXXX.
|
|
||||||
|
|
||||||
### You have a solution
|
|
||||||
|
|
||||||
Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
|
|
||||||
your [problem](#you-have-a-problem), and any pending/merged/rejected PR covering your solution.
|
|
||||||
|
|
||||||
If the solution is already reported, try it out and +1 the pull request if the
|
|
||||||
solution works ok. On the other hand, if you think your solution is better, post
|
|
||||||
it with reference to the other one so we can have both solutions to compare.
|
|
||||||
|
|
||||||
If not, then go ahead and submit a PR. Please copy to anyone relevant (e.g. plugin
|
|
||||||
maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
|
|
||||||
|
|
||||||
### You have an addition
|
|
||||||
|
|
||||||
Please [do not](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#dont-send-us-your-theme-for-now)
|
|
||||||
send themes for now.
|
|
||||||
|
|
||||||
Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests
|
|
||||||
covering or related to what you want to add.
|
|
||||||
|
|
||||||
If you find one, try it out and work with the author on a common solution.
|
|
||||||
|
|
||||||
If not, then go ahead and submit a PR. Please copy to anyone relevant (e.g. plugin
|
|
||||||
maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
|
|
||||||
|
|
||||||
For any extensive change, such as a new plugin, you will have to find testers to +1 your PR.
|
|
||||||
|
|
||||||
### New plugin aliases
|
|
||||||
|
|
||||||
We acknowledge that aliases are a core part of Oh My Zsh. There are plugins that have +100 aliases!
|
|
||||||
|
|
||||||
This has become an issue for two opposing reasons:
|
|
||||||
|
|
||||||
- Some users want to have their personal aliases in Oh My Zsh.
|
|
||||||
- Some users don't want any aliases at all and feel that there are too many.
|
|
||||||
|
|
||||||
Because of this, from now on, we require that new aliases follow these conditions:
|
|
||||||
|
|
||||||
1. They will be used by many people, not just a few.
|
|
||||||
2. The aliases will be used many times and for common tasks.
|
|
||||||
3. Prefer one generic alias over many specific ones.
|
|
||||||
4. When justifying the need for an alias, talk about workflows where you'll use it,
|
|
||||||
preferably in combination with other aliases.
|
|
||||||
5. If a command with the same name exists, look for a different alias name.
|
|
||||||
|
|
||||||
This list is not exhaustive! Please remember that your alias will be in the machines of many people,
|
|
||||||
so it should be justified why they should have it.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
## Use the Search, Luke
|
|
||||||
|
|
||||||
_May the Force (of past experiences) be with you_
|
|
||||||
|
|
||||||
GitHub offers [many search features](https://help.github.com/articles/searching-github/)
|
|
||||||
to help you check whether a similar contribution to yours already exists. Please search
|
|
||||||
before making any contribution, it avoids duplicates and eases maintenance. Trust me,
|
|
||||||
that works 90% of the time.
|
|
||||||
|
|
||||||
You can also take a look at the [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ)
|
|
||||||
to be sure your contribution has not already come up.
|
|
||||||
|
|
||||||
If all fails, your thing has probably not been reported yet, so you can go ahead
|
|
||||||
and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests).
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
## Commit Guidelines
|
|
||||||
|
|
||||||
Oh My Zsh uses the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
||||||
specification. The automatic changelog tool uses these to automatically generate
|
|
||||||
a changelog based on the commit messages. Here's a guide to writing a commit message
|
|
||||||
to allow this:
|
|
||||||
|
|
||||||
### Format
|
|
||||||
|
|
||||||
```
|
|
||||||
type(scope)!: subject
|
|
||||||
```
|
|
||||||
|
|
||||||
- `type`: the type of the commit is one of the following:
|
|
||||||
|
|
||||||
- `feat`: new features.
|
|
||||||
- `fix`: bug fixes.
|
|
||||||
- `docs`: documentation changes.
|
|
||||||
- `refactor`: refactor of a particular code section without introducing
|
|
||||||
new features or bug fixes.
|
|
||||||
- `style`: code style improvements.
|
|
||||||
- `perf`: performance improvements.
|
|
||||||
- `test`: changes to the test suite.
|
|
||||||
- `ci`: changes to the CI system.
|
|
||||||
- `build`: changes to the build system (we don't yet have one so this shouldn't apply).
|
|
||||||
- `chore`: for other changes that don't match previous types. This doesn't appear
|
|
||||||
in the changelog.
|
|
||||||
|
|
||||||
- `scope`: section of the codebase that the commit makes changes to. If it makes changes to
|
|
||||||
many sections, or if no section in particular is modified, leave blank without the parentheses.
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
- Commit that changes the `git` plugin:
|
|
||||||
```
|
|
||||||
feat(git): add alias for `git commit`
|
|
||||||
```
|
|
||||||
|
|
||||||
- Commit that changes many plugins:
|
|
||||||
```
|
|
||||||
style: fix inline declaration of arrays
|
|
||||||
```
|
|
||||||
|
|
||||||
For changes to plugins or themes, the scope should be the plugin or theme name:
|
|
||||||
|
|
||||||
- ✅ `fix(agnoster): commit subject`
|
|
||||||
- ❌ `fix(theme/agnoster): commit subject`
|
|
||||||
|
|
||||||
- `!`: this goes after the `scope` (or the `type` if scope is empty), to indicate that the commit
|
|
||||||
introduces breaking changes.
|
|
||||||
|
|
||||||
Optionally, you can specify a message that the changelog tool will display to the user to indicate
|
|
||||||
what's changed and what they can do to deal with it. You can use multiple lines to type this message;
|
|
||||||
the changelog parser will keep reading until the end of the commit message or until it finds an empty
|
|
||||||
line.
|
|
||||||
|
|
||||||
Example (made up):
|
|
||||||
|
|
||||||
```
|
|
||||||
style(agnoster)!: change dirty git repo glyph
|
|
||||||
|
|
||||||
BREAKING CHANGE: the glyph to indicate when a git repository is dirty has
|
|
||||||
changed from a Powerline character to a standard UTF-8 emoji. You can
|
|
||||||
change it back by setting `ZSH_THEME_DIRTY_GLYPH`.
|
|
||||||
|
|
||||||
Fixes #420
|
|
||||||
|
|
||||||
Co-authored-by: Username <email>
|
|
||||||
```
|
|
||||||
|
|
||||||
- `subject`: a brief description of the changes. This will be displayed in the changelog. If you need
|
|
||||||
to specify other details, you can use the commit body, but it won't be visible.
|
|
||||||
|
|
||||||
Formatting tricks: the commit subject may contain:
|
|
||||||
|
|
||||||
- Links to related issues or PRs by writing `#issue`. This will be highlighted by the changelog tool:
|
|
||||||
```
|
|
||||||
feat(archlinux): add support for aura AUR helper (#9467)
|
|
||||||
```
|
|
||||||
|
|
||||||
- Formatted inline code by using backticks: the text between backticks will also be highlighted by
|
|
||||||
the changelog tool:
|
|
||||||
```
|
|
||||||
feat(shell-proxy): enable unexported `DEFAULT_PROXY` setting (#9774)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Style
|
|
||||||
|
|
||||||
Try to keep the first commit line short. It's harder to do using this commit style but try to be
|
|
||||||
concise, and if you need more space, you can use the commit body. Try to make sure that the commit
|
|
||||||
subject is clear and precise enough that users will know what changed by just looking at the changelog.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
## Volunteer
|
|
||||||
|
|
||||||
Very nice!! :)
|
|
||||||
|
|
||||||
Please have a look at the [Volunteer](https://github.com/ohmyzsh/ohmyzsh/wiki/Volunteers)
|
|
||||||
page for instructions on where to start and more.
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2009-2022 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors)
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,553 +0,0 @@
|
||||||
<p align="center"><img src="https://ohmyzsh.s3.amazonaws.com/omz-ansi-github.png" alt="Oh My Zsh"></p>
|
|
||||||
|
|
||||||
Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/)
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
Sounds boring. Let's try again.
|
|
||||||
|
|
||||||
**Oh My Zsh will not make you a 10x developer...but you may feel like one.**
|
|
||||||
|
|
||||||
Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke
|
|
||||||
in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes.
|
|
||||||
Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_
|
|
||||||
|
|
||||||
Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll
|
|
||||||
use the time that you're saving to start flossing more often. 😬
|
|
||||||
|
|
||||||
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly
|
|
||||||
Twitter), and join us on [Discord](https://discord.gg/ohmyzsh).
|
|
||||||
|
|
||||||
[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
|
|
||||||
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ohmyzsh?label=%40ohmyzsh&logo=x&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
|
||||||
[![Mastodon Follow](https://img.shields.io/mastodon/follow/111169632522566717?label=%40ohmyzsh&domain=https%3A%2F%2Fmstdn.social&logo=mastodon&style=flat)](https://mstdn.social/@ohmyzsh)
|
|
||||||
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh)
|
|
||||||
[![Gitpod ready](https://img.shields.io/badge/Gitpod-ready-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh)
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Table of Contents</summary>
|
|
||||||
|
|
||||||
- [Getting Started](#getting-started)
|
|
||||||
- [Operating System Compatibility](#operating-system-compatibility)
|
|
||||||
- [Prerequisites](#prerequisites)
|
|
||||||
- [Basic Installation](#basic-installation)
|
|
||||||
- [Manual Inspection](#manual-inspection)
|
|
||||||
- [Using Oh My Zsh](#using-oh-my-zsh)
|
|
||||||
- [Plugins](#plugins)
|
|
||||||
- [Enabling Plugins](#enabling-plugins)
|
|
||||||
- [Using Plugins](#using-plugins)
|
|
||||||
- [Themes](#themes)
|
|
||||||
- [Selecting A Theme](#selecting-a-theme)
|
|
||||||
- [FAQ](#faq)
|
|
||||||
- [Advanced Topics](#advanced-topics)
|
|
||||||
- [Advanced Installation](#advanced-installation)
|
|
||||||
- [Custom Directory](#custom-directory)
|
|
||||||
- [Unattended Install](#unattended-install)
|
|
||||||
- [Installing From A Forked Repository](#installing-from-a-forked-repository)
|
|
||||||
- [Manual Installation](#manual-installation)
|
|
||||||
- [Installation Problems](#installation-problems)
|
|
||||||
- [Custom Plugins And Themes](#custom-plugins-and-themes)
|
|
||||||
- [Enable GNU ls In macOS And freeBSD Systems](#enable-gnu-ls-in-macos-and-freebsd-systems)
|
|
||||||
- [Skip Aliases](#skip-aliases)
|
|
||||||
- [Async git prompt](#async-git-prompt)
|
|
||||||
- [Getting Updates](#getting-updates)
|
|
||||||
- [Updates Verbosity](#updates-verbosity)
|
|
||||||
- [Manual Updates](#manual-updates)
|
|
||||||
- [Uninstalling Oh My Zsh](#uninstalling-oh-my-zsh)
|
|
||||||
- [How Do I Contribute To Oh My Zsh?](#how-do-i-contribute-to-oh-my-zsh)
|
|
||||||
- [Do Not Send Us Themes](#do-not-send-us-themes)
|
|
||||||
- [Contributors](#contributors)
|
|
||||||
- [Follow Us](#follow-us)
|
|
||||||
- [Merchandise](#merchandise)
|
|
||||||
- [License](#license)
|
|
||||||
- [About Planet Argon](#about-planet-argon)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
### Operating System Compatibility
|
|
||||||
|
|
||||||
| O/S | Status |
|
|
||||||
| :------------- | :----: |
|
|
||||||
| Android | ✅ |
|
|
||||||
| freeBSD | ✅ |
|
|
||||||
| LCARS | 🛸 |
|
|
||||||
| Linux | ✅ |
|
|
||||||
| macOS | ✅ |
|
|
||||||
| OS/2 Warp | ❌ |
|
|
||||||
| Windows (WSL2) | ✅ |
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
- [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and
|
|
||||||
newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here:
|
|
||||||
[Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
|
|
||||||
- `curl` or `wget` should be installed
|
|
||||||
- `git` should be installed (recommended v2.4.11 or higher)
|
|
||||||
|
|
||||||
### Basic Installation
|
|
||||||
|
|
||||||
Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the
|
|
||||||
command-line with either `curl`, `wget` or another similar tool.
|
|
||||||
|
|
||||||
| Method | Command |
|
|
||||||
| :-------- | :------------------------------------------------------------------------------------------------ |
|
|
||||||
| **curl** | `sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
|
|
||||||
| **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
|
|
||||||
| **fetch** | `sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
|
|
||||||
|
|
||||||
Alternatively, the installer is also mirrored outside GitHub. Using this URL instead may be required if you're
|
|
||||||
in a country like China or India (for certain ISPs), that blocks `raw.githubusercontent.com`:
|
|
||||||
|
|
||||||
| Method | Command |
|
|
||||||
| :-------- | :------------------------------------------------ |
|
|
||||||
| **curl** | `sh -c "$(curl -fsSL https://install.ohmyz.sh/)"` |
|
|
||||||
| **wget** | `sh -c "$(wget -O- https://install.ohmyz.sh/)"` |
|
|
||||||
| **fetch** | `sh -c "$(fetch -o - https://install.ohmyz.sh/)"` |
|
|
||||||
|
|
||||||
_Note that any previous `.zshrc` will be renamed to `.zshrc.pre-oh-my-zsh`. After installation, you can move
|
|
||||||
the configuration you want to preserve into the new `.zshrc`._
|
|
||||||
|
|
||||||
#### Manual Inspection
|
|
||||||
|
|
||||||
It's a good idea to inspect the install script from projects you don't yet know. You can do that by
|
|
||||||
downloading the install script first, looking through it so everything looks normal, then running it:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
|
|
||||||
sh install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
If the above URL times out or otherwise fails, you may have to substitute the URL for
|
|
||||||
`https://install.ohmyz.sh` to be able to get the script.
|
|
||||||
|
|
||||||
## Using Oh My Zsh
|
|
||||||
|
|
||||||
### Plugins
|
|
||||||
|
|
||||||
Oh My Zsh comes with a shitload of plugins for you to take advantage of. You can take a look in the
|
|
||||||
[plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the
|
|
||||||
[wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available.
|
|
||||||
|
|
||||||
#### Enabling Plugins
|
|
||||||
|
|
||||||
Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the
|
|
||||||
`.zshrc` file. You'll find the zshrc file in your `$HOME` directory. Open it with your favorite text editor
|
|
||||||
and you'll see a spot to list all the plugins you want to load.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
vi ~/.zshrc
|
|
||||||
```
|
|
||||||
|
|
||||||
For example, this might begin to look like this:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
plugins=(
|
|
||||||
git
|
|
||||||
bundler
|
|
||||||
dotenv
|
|
||||||
macos
|
|
||||||
rake
|
|
||||||
rbenv
|
|
||||||
ruby
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
_Note that the plugins are separated by whitespace (spaces, tabs, new lines...). **Do not** use commas between
|
|
||||||
them or it will break._
|
|
||||||
|
|
||||||
#### Using Plugins
|
|
||||||
|
|
||||||
Each built-in plugin includes a **README**, documenting it. This README should show the aliases (if the plugin
|
|
||||||
adds any) and extra goodies that are included in that particular plugin.
|
|
||||||
|
|
||||||
### Themes
|
|
||||||
|
|
||||||
We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one
|
|
||||||
hundred and fifty themes now bundled. Most of them have
|
|
||||||
[screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!).
|
|
||||||
Check them out!
|
|
||||||
|
|
||||||
#### Selecting A Theme
|
|
||||||
|
|
||||||
_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right
|
|
||||||
one (for him)._
|
|
||||||
|
|
||||||
Once you find a theme that you'd like to use, you will need to edit the `~/.zshrc` file. You'll see an
|
|
||||||
environment variable (all caps) in there that looks like:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH_THEME="robbyrussell"
|
|
||||||
```
|
|
||||||
|
|
||||||
To use a different theme, simply change the value to match the name of your desired theme. For example:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH_THEME="agnoster" # (this is one of the fancy ones)
|
|
||||||
# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
> [!NOTE]
|
|
||||||
> You will many times see screenshots for a zsh theme, and try it out, and find that it doesn't look the same for you.
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
|
|
||||||
> This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a
|
|
||||||
> [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. Without them, these themes
|
|
||||||
> will render weird prompt symbols. Check out
|
|
||||||
> [the FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt) for more
|
|
||||||
> information.
|
|
||||||
>
|
|
||||||
> Also, beware that themes only control what your prompt looks like. This is, the text you see before or after
|
|
||||||
> your cursor, where you'll type your commands. Themes don't control things such as the colors of your
|
|
||||||
> terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can
|
|
||||||
> change in your terminal emulator. For more information, see
|
|
||||||
> [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme).
|
|
||||||
|
|
||||||
Open up a new terminal window and your prompt should look something like this:
|
|
||||||
|
|
||||||
![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png)
|
|
||||||
|
|
||||||
In case you did not find a suitable theme for your needs, please have a look at the wiki for
|
|
||||||
[more of them](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes).
|
|
||||||
|
|
||||||
If you're feeling feisty, you can let the computer select one randomly for you each time you open a new
|
|
||||||
terminal window.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH_THEME="random" # (...please let it be pie... please be some pie..)
|
|
||||||
```
|
|
||||||
|
|
||||||
And if you want to pick random theme from a list of your favorite themes:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH_THEME_RANDOM_CANDIDATES=(
|
|
||||||
"robbyrussell"
|
|
||||||
"agnoster"
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
If you only know which themes you don't like, you can add them similarly to an ignored list:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH_THEME_RANDOM_IGNORED=(pygmalion tjkirch_mod)
|
|
||||||
```
|
|
||||||
|
|
||||||
### FAQ
|
|
||||||
|
|
||||||
If you have some more questions or issues, you might find a solution in our
|
|
||||||
[FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ).
|
|
||||||
|
|
||||||
## Advanced Topics
|
|
||||||
|
|
||||||
If you're the type that likes to get their hands dirty, these sections might resonate.
|
|
||||||
|
|
||||||
### Advanced Installation
|
|
||||||
|
|
||||||
Some users may want to manually install Oh My Zsh, or change the default path or other settings that the
|
|
||||||
installer accepts (these settings are also documented at the top of the install script).
|
|
||||||
|
|
||||||
#### Custom Directory
|
|
||||||
|
|
||||||
The default location is `~/.oh-my-zsh` (hidden in your home directory, you can access it with
|
|
||||||
`cd ~/.oh-my-zsh`)
|
|
||||||
|
|
||||||
If you'd like to change the install directory with the `ZSH` environment variable, either by running
|
|
||||||
`export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH="$HOME/.dotfiles/oh-my-zsh" sh install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Unattended Install
|
|
||||||
|
|
||||||
If you're running the Oh My Zsh install script as part of an automated install, you can pass the
|
|
||||||
`--unattended` flag to the `install.sh` script. This will have the effect of not trying to change the default
|
|
||||||
shell, and it also won't run `zsh` when the installation has finished.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
|
||||||
```
|
|
||||||
|
|
||||||
If you're in China, India, or another country that blocks `raw.githubusercontent.com`, you may have to
|
|
||||||
substitute the URL for `https://install.ohmyz.sh` for it to install.
|
|
||||||
|
|
||||||
#### Installing From A Forked Repository
|
|
||||||
|
|
||||||
The install script also accepts these variables to allow the installation of a different repository:
|
|
||||||
|
|
||||||
- `REPO` (default: `ohmyzsh/ohmyzsh`): this takes the form of `owner/repository`. If you set this variable,
|
|
||||||
the installer will look for a repository at `https://github.com/{owner}/{repository}`.
|
|
||||||
|
|
||||||
- `REMOTE` (default: `https://github.com/${REPO}.git`): this is the full URL of the git repository clone. You
|
|
||||||
can use this setting if you want to install from a fork that is not on GitHub (GitLab, Bitbucket...) or if
|
|
||||||
you want to clone with SSH instead of HTTPS (`git@github.com:user/project.git`).
|
|
||||||
|
|
||||||
_NOTE: it's incompatible with setting the `REPO` variable. This setting will take precedence._
|
|
||||||
|
|
||||||
- `BRANCH` (default: `master`): you can use this setting if you want to change the default branch to be
|
|
||||||
checked out when cloning the repository. This might be useful for testing a Pull Request, or if you want to
|
|
||||||
use a branch other than `master`.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
REPO=apjanke/oh-my-zsh BRANCH=edge sh install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Manual Installation
|
|
||||||
|
|
||||||
##### 1. Clone The Repository <!-- omit in toc -->
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
|
|
||||||
```
|
|
||||||
|
|
||||||
##### 2. _Optionally_, Backup Your Existing `~/.zshrc` File <!-- omit in toc -->
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cp ~/.zshrc ~/.zshrc.orig
|
|
||||||
```
|
|
||||||
|
|
||||||
##### 3. Create A New Zsh Configuration File <!-- omit in toc -->
|
|
||||||
|
|
||||||
You can create a new zsh config file by copying the template that we have included for you.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
|
|
||||||
```
|
|
||||||
|
|
||||||
##### 4. Change Your Default Shell <!-- omit in toc -->
|
|
||||||
|
|
||||||
```sh
|
|
||||||
chsh -s $(which zsh)
|
|
||||||
```
|
|
||||||
|
|
||||||
You must log out from your user session and log back in to see this change.
|
|
||||||
|
|
||||||
##### 5. Initialize Your New Zsh Configuration <!-- omit in toc -->
|
|
||||||
|
|
||||||
Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.
|
|
||||||
|
|
||||||
### Installation Problems
|
|
||||||
|
|
||||||
If you have any hiccups installing, here are a few common fixes.
|
|
||||||
|
|
||||||
- You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after
|
|
||||||
switching to `oh-my-zsh`.
|
|
||||||
- If you installed manually or changed the install location, check the `ZSH` environment variable in
|
|
||||||
`~/.zshrc`.
|
|
||||||
|
|
||||||
### Custom Plugins And Themes
|
|
||||||
|
|
||||||
If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/`
|
|
||||||
directory.
|
|
||||||
|
|
||||||
If you have many functions that go well together, you can put them as a `XYZ.plugin.zsh` file in the
|
|
||||||
`custom/plugins/` directory and then enable this plugin.
|
|
||||||
|
|
||||||
If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the
|
|
||||||
same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.
|
|
||||||
|
|
||||||
### Enable GNU ls In macOS And freeBSD Systems
|
|
||||||
|
|
||||||
<a name="enable-gnu-ls"></a>
|
|
||||||
|
|
||||||
The default behaviour in Oh My Zsh is to use BSD `ls` in macOS and FreeBSD systems. If GNU `ls` is installed
|
|
||||||
(as `gls` command), you can choose to use it instead. To do it, you can use zstyle-based config before
|
|
||||||
sourcing `oh-my-zsh.sh`:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
zstyle ':omz:lib:theme-and-appearance' gnu-ls yes
|
|
||||||
```
|
|
||||||
|
|
||||||
_Note: this is not compatible with `DISABLE_LS_COLORS=true`_
|
|
||||||
|
|
||||||
### Skip Aliases
|
|
||||||
|
|
||||||
<a name="remove-directories-aliases"></a>
|
|
||||||
|
|
||||||
If you want to skip default Oh My Zsh aliases (those defined in `lib/*` files) or plugin aliases, you can use
|
|
||||||
the settings below in your `~/.zshrc` file, **before Oh My Zsh is loaded**. Note that there are many different
|
|
||||||
ways to skip aliases, depending on your needs.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Skip all aliases, in lib files and enabled plugins
|
|
||||||
zstyle ':omz:*' aliases no
|
|
||||||
|
|
||||||
# Skip all aliases in lib files
|
|
||||||
zstyle ':omz:lib:*' aliases no
|
|
||||||
# Skip only aliases defined in the directories.zsh lib file
|
|
||||||
zstyle ':omz:lib:directories' aliases no
|
|
||||||
|
|
||||||
# Skip all plugin aliases
|
|
||||||
zstyle ':omz:plugins:*' aliases no
|
|
||||||
# Skip only the aliases from the git plugin
|
|
||||||
zstyle ':omz:plugins:git' aliases no
|
|
||||||
```
|
|
||||||
|
|
||||||
You can combine these in other ways taking into account that more specific scopes take precedence:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Skip all plugin aliases, except for the git plugin
|
|
||||||
zstyle ':omz:plugins:*' aliases no
|
|
||||||
zstyle ':omz:plugins:git' aliases yes
|
|
||||||
```
|
|
||||||
|
|
||||||
A previous version of this feature was using the setting below, which has been removed:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:directories' aliases no
|
|
||||||
```
|
|
||||||
|
|
||||||
Instead, you can now use the following:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:lib:directories' aliases no
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Notice <!-- omit in toc -->
|
|
||||||
|
|
||||||
> This feature is currently in a testing phase and it may be subject to change in the future. It is also not
|
|
||||||
> currently compatible with plugin managers such as zpm or zinit, which don't source the init script
|
|
||||||
> (`oh-my-zsh.sh`) where this feature is implemented in.
|
|
||||||
|
|
||||||
> It is also not currently aware of "aliases" that are defined as functions. Example of such are `gccd`,
|
|
||||||
> `ggf`, or `ggl` functions from the git plugin.
|
|
||||||
|
|
||||||
### Async git prompt
|
|
||||||
|
|
||||||
Async prompt functions are an experimental feature (included on April 3, 2024) that allows Oh My Zsh to render
|
|
||||||
prompt information asynchronously. This can improve prompt rendering performance, but it might not work well
|
|
||||||
with some setups. We hope that's not an issue, but if you're seeing problems with this new feature, you can
|
|
||||||
turn it off by setting the following in your .zshrc file, before Oh My Zsh is sourced:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:alpha:lib:git' async-prompt no
|
|
||||||
```
|
|
||||||
|
|
||||||
If your problem is that the git prompt just stopped appearing, you can try to force it setting the following
|
|
||||||
configuration before `oh-my-zsh.sh` is sourced. If it still does not work, please open an issue with your
|
|
||||||
case.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:alpha:lib:git' async-prompt force
|
|
||||||
```
|
|
||||||
|
|
||||||
## Getting Updates
|
|
||||||
|
|
||||||
By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by
|
|
||||||
adding a line to your `~/.zshrc` file, **before Oh My Zsh is loaded**:
|
|
||||||
|
|
||||||
1. Automatic update without confirmation prompt:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:update' mode auto
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Just offer a reminder every few days, if there are updates available:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:update' mode reminder
|
|
||||||
```
|
|
||||||
|
|
||||||
3. To disable automatic updates entirely:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:update' mode disabled
|
|
||||||
```
|
|
||||||
|
|
||||||
NOTE: you can control how often Oh My Zsh checks for updates with the following setting:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# This will check for updates every 7 days
|
|
||||||
zstyle ':omz:update' frequency 7
|
|
||||||
# This will check for updates every time you open the terminal (not recommended)
|
|
||||||
zstyle ':omz:update' frequency 0
|
|
||||||
```
|
|
||||||
|
|
||||||
### Updates Verbosity
|
|
||||||
|
|
||||||
You can also limit the update verbosity with the following settings:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
zstyle ':omz:update' verbose default # default update prompt
|
|
||||||
|
|
||||||
zstyle ':omz:update' verbose minimal # only few lines
|
|
||||||
|
|
||||||
zstyle ':omz:update' verbose silent # only errors
|
|
||||||
```
|
|
||||||
|
|
||||||
### Manual Updates
|
|
||||||
|
|
||||||
If you'd like to update at any point in time (maybe someone just released a new plugin and you don't want to
|
|
||||||
wait a week?) you just need to run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
omz update
|
|
||||||
```
|
|
||||||
|
|
||||||
Magic! 🎉
|
|
||||||
|
|
||||||
## Uninstalling Oh My Zsh
|
|
||||||
|
|
||||||
Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
|
|
||||||
|
|
||||||
If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove
|
|
||||||
itself and revert your previous `bash` or `zsh` configuration.
|
|
||||||
|
|
||||||
## How Do I Contribute To Oh My Zsh?
|
|
||||||
|
|
||||||
Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md).
|
|
||||||
|
|
||||||
I'm far from being a [Zsh](https://www.zsh.org/) expert and suspect there are many ways to improve – if you
|
|
||||||
have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send
|
|
||||||
pull requests!
|
|
||||||
|
|
||||||
We also need people to test out pull requests. So take a look through
|
|
||||||
[the open issues](https://github.com/ohmyzsh/ohmyzsh/issues) and help where you can.
|
|
||||||
|
|
||||||
See [Contributing](CONTRIBUTING.md) for more details.
|
|
||||||
|
|
||||||
### Do Not Send Us Themes
|
|
||||||
|
|
||||||
We have (more than) enough themes for the time being. Please add your theme to the
|
|
||||||
[external themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) wiki page.
|
|
||||||
|
|
||||||
## Contributors
|
|
||||||
|
|
||||||
Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help
|
|
||||||
from our contributors, it wouldn't be so awesome.
|
|
||||||
|
|
||||||
Thank you so much!
|
|
||||||
|
|
||||||
<a href="https://github.com/ohmyzsh/ohmyzsh/graphs/contributors">
|
|
||||||
<img src="https://contrib.rocks/image?repo=ohmyzsh/ohmyzsh" width="100%"/>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
## Follow Us
|
|
||||||
|
|
||||||
We're on social media:
|
|
||||||
|
|
||||||
- [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly Twitter). You should follow it.
|
|
||||||
- [Facebook](https://www.facebook.com/Oh-My-Zsh-296616263819290/) poke us.
|
|
||||||
- [Instagram](https://www.instagram.com/_ohmyzsh/) tag us in your post showing Oh My Zsh!
|
|
||||||
- [Discord](https://discord.gg/ohmyzsh) to chat with us!
|
|
||||||
|
|
||||||
## Merchandise
|
|
||||||
|
|
||||||
We have
|
|
||||||
[stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github)
|
|
||||||
for you to show off your love of Oh My Zsh. Again, you will become the talk of the town!
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Oh My Zsh is released under the [MIT license](LICENSE.txt).
|
|
||||||
|
|
||||||
## About Planet Argon
|
|
||||||
|
|
||||||
![Planet Argon](https://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg)
|
|
||||||
|
|
||||||
Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a
|
|
||||||
[Ruby on Rails development agency](https://www.planetargon.com/services/ruby-on-rails-development?utm_source=github).
|
|
||||||
Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github).
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Security Policy
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
At the moment Oh My Zsh only considers the very latest commit to be supported.
|
|
||||||
We combine that with our fast response to incidents and the automated updates
|
|
||||||
to minimize the time between vulnerability publication and patch release.
|
|
||||||
|
|
||||||
| Version | Supported |
|
|
||||||
|:-------------- |:------------------ |
|
|
||||||
| master | :white_check_mark: |
|
|
||||||
| other commits | :x: |
|
|
||||||
|
|
||||||
In the near future we will introduce versioning, so expect this section to change.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
**Do not submit an issue or pull request**: this might reveal the vulnerability.
|
|
||||||
|
|
||||||
Instead, you should use the form to [privately report a vulnerability to us via GitHub](https://github.com/ohmyzsh/ohmyzsh/security/advisories/new)
|
|
||||||
or email the maintainers directly at: [**security@ohmyz.sh**](mailto:security@ohmyz.sh).
|
|
||||||
|
|
||||||
We will deal with the vulnerability privately and submit a patch as soon as possible.
|
|
4
dot_oh-my-zsh/cache/SYS_ALL_UNITS--system
vendored
4
dot_oh-my-zsh/cache/SYS_ALL_UNITS--system
vendored
File diff suppressed because one or more lines are too long
4
dot_oh-my-zsh/cache/SYS_ALL_UNITS--user
vendored
4
dot_oh-my-zsh/cache/SYS_ALL_UNITS--user
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
dot_oh-my-zsh/cache/completions/_cargo
vendored
2
dot_oh-my-zsh/cache/completions/_cargo
vendored
|
@ -1,2 +0,0 @@
|
||||||
#compdef cargo
|
|
||||||
source "$(rustc +${${(z)$(rustup default)}[1]} --print sysroot)"/share/zsh/site-functions/_cargo
|
|
212
dot_oh-my-zsh/cache/completions/_docker
vendored
212
dot_oh-my-zsh/cache/completions/_docker
vendored
|
@ -1,212 +0,0 @@
|
||||||
#compdef docker
|
|
||||||
compdef _docker docker
|
|
||||||
|
|
||||||
# zsh completion for docker -*- shell-script -*-
|
|
||||||
|
|
||||||
__docker_debug()
|
|
||||||
{
|
|
||||||
local file="$BASH_COMP_DEBUG_FILE"
|
|
||||||
if [[ -n ${file} ]]; then
|
|
||||||
echo "$*" >> "${file}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_docker()
|
|
||||||
{
|
|
||||||
local shellCompDirectiveError=1
|
|
||||||
local shellCompDirectiveNoSpace=2
|
|
||||||
local shellCompDirectiveNoFileComp=4
|
|
||||||
local shellCompDirectiveFilterFileExt=8
|
|
||||||
local shellCompDirectiveFilterDirs=16
|
|
||||||
local shellCompDirectiveKeepOrder=32
|
|
||||||
|
|
||||||
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
|
|
||||||
local -a completions
|
|
||||||
|
|
||||||
__docker_debug "\n========= starting completion logic =========="
|
|
||||||
__docker_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}"
|
|
||||||
|
|
||||||
# The user could have moved the cursor backwards on the command-line.
|
|
||||||
# We need to trigger completion from the $CURRENT location, so we need
|
|
||||||
# to truncate the command-line ($words) up to the $CURRENT location.
|
|
||||||
# (We cannot use $CURSOR as its value does not work when a command is an alias.)
|
|
||||||
words=("${=words[1,CURRENT]}")
|
|
||||||
__docker_debug "Truncated words[*]: ${words[*]},"
|
|
||||||
|
|
||||||
lastParam=${words[-1]}
|
|
||||||
lastChar=${lastParam[-1]}
|
|
||||||
__docker_debug "lastParam: ${lastParam}, lastChar: ${lastChar}"
|
|
||||||
|
|
||||||
# For zsh, when completing a flag with an = (e.g., docker -n=<TAB>)
|
|
||||||
# completions must be prefixed with the flag
|
|
||||||
setopt local_options BASH_REMATCH
|
|
||||||
if [[ "${lastParam}" =~ '-.*=' ]]; then
|
|
||||||
# We are dealing with a flag with an =
|
|
||||||
flagPrefix="-P ${BASH_REMATCH}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prepare the command to obtain completions
|
|
||||||
requestComp="${words[1]} __completeNoDesc ${words[2,-1]}"
|
|
||||||
if [ "${lastChar}" = "" ]; then
|
|
||||||
# If the last parameter is complete (there is a space following it)
|
|
||||||
# We add an extra empty parameter so we can indicate this to the go completion code.
|
|
||||||
__docker_debug "Adding extra empty parameter"
|
|
||||||
requestComp="${requestComp} \"\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
__docker_debug "About to call: eval ${requestComp}"
|
|
||||||
|
|
||||||
# Use eval to handle any environment variables and such
|
|
||||||
out=$(eval ${requestComp} 2>/dev/null)
|
|
||||||
__docker_debug "completion output: ${out}"
|
|
||||||
|
|
||||||
# Extract the directive integer following a : from the last line
|
|
||||||
local lastLine
|
|
||||||
while IFS='\n' read -r line; do
|
|
||||||
lastLine=${line}
|
|
||||||
done < <(printf "%s\n" "${out[@]}")
|
|
||||||
__docker_debug "last line: ${lastLine}"
|
|
||||||
|
|
||||||
if [ "${lastLine[1]}" = : ]; then
|
|
||||||
directive=${lastLine[2,-1]}
|
|
||||||
# Remove the directive including the : and the newline
|
|
||||||
local suffix
|
|
||||||
(( suffix=${#lastLine}+2))
|
|
||||||
out=${out[1,-$suffix]}
|
|
||||||
else
|
|
||||||
# There is no directive specified. Leave $out as is.
|
|
||||||
__docker_debug "No directive found. Setting do default"
|
|
||||||
directive=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
__docker_debug "directive: ${directive}"
|
|
||||||
__docker_debug "completions: ${out}"
|
|
||||||
__docker_debug "flagPrefix: ${flagPrefix}"
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
|
|
||||||
__docker_debug "Completion received error. Ignoring completions."
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
local activeHelpMarker="_activeHelp_ "
|
|
||||||
local endIndex=${#activeHelpMarker}
|
|
||||||
local startIndex=$((${#activeHelpMarker}+1))
|
|
||||||
local hasActiveHelp=0
|
|
||||||
while IFS='\n' read -r comp; do
|
|
||||||
# Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
|
|
||||||
if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
|
|
||||||
__docker_debug "ActiveHelp found: $comp"
|
|
||||||
comp="${comp[$startIndex,-1]}"
|
|
||||||
if [ -n "$comp" ]; then
|
|
||||||
compadd -x "${comp}"
|
|
||||||
__docker_debug "ActiveHelp will need delimiter"
|
|
||||||
hasActiveHelp=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$comp" ]; then
|
|
||||||
# If requested, completions are returned with a description.
|
|
||||||
# The description is preceded by a TAB character.
|
|
||||||
# For zsh's _describe, we need to use a : instead of a TAB.
|
|
||||||
# We first need to escape any : as part of the completion itself.
|
|
||||||
comp=${comp//:/\\:}
|
|
||||||
|
|
||||||
local tab="$(printf '\t')"
|
|
||||||
comp=${comp//$tab/:}
|
|
||||||
|
|
||||||
__docker_debug "Adding completion: ${comp}"
|
|
||||||
completions+=${comp}
|
|
||||||
lastComp=$comp
|
|
||||||
fi
|
|
||||||
done < <(printf "%s\n" "${out[@]}")
|
|
||||||
|
|
||||||
# Add a delimiter after the activeHelp statements, but only if:
|
|
||||||
# - there are completions following the activeHelp statements, or
|
|
||||||
# - file completion will be performed (so there will be choices after the activeHelp)
|
|
||||||
if [ $hasActiveHelp -eq 1 ]; then
|
|
||||||
if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
|
|
||||||
__docker_debug "Adding activeHelp delimiter"
|
|
||||||
compadd -x "--"
|
|
||||||
hasActiveHelp=0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
|
|
||||||
__docker_debug "Activating nospace."
|
|
||||||
noSpace="-S ''"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
|
|
||||||
__docker_debug "Activating keep order."
|
|
||||||
keepOrder="-V"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
|
||||||
# File extension filtering
|
|
||||||
local filteringCmd
|
|
||||||
filteringCmd='_files'
|
|
||||||
for filter in ${completions[@]}; do
|
|
||||||
if [ ${filter[1]} != '*' ]; then
|
|
||||||
# zsh requires a glob pattern to do file filtering
|
|
||||||
filter="\*.$filter"
|
|
||||||
fi
|
|
||||||
filteringCmd+=" -g $filter"
|
|
||||||
done
|
|
||||||
filteringCmd+=" ${flagPrefix}"
|
|
||||||
|
|
||||||
__docker_debug "File filtering command: $filteringCmd"
|
|
||||||
_arguments '*:filename:'"$filteringCmd"
|
|
||||||
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
|
|
||||||
# File completion for directories only
|
|
||||||
local subdir
|
|
||||||
subdir="${completions[1]}"
|
|
||||||
if [ -n "$subdir" ]; then
|
|
||||||
__docker_debug "Listing directories in $subdir"
|
|
||||||
pushd "${subdir}" >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
__docker_debug "Listing directories in ."
|
|
||||||
fi
|
|
||||||
|
|
||||||
local result
|
|
||||||
_arguments '*:dirname:_files -/'" ${flagPrefix}"
|
|
||||||
result=$?
|
|
||||||
if [ -n "$subdir" ]; then
|
|
||||||
popd >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
return $result
|
|
||||||
else
|
|
||||||
__docker_debug "Calling _describe"
|
|
||||||
if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then
|
|
||||||
__docker_debug "_describe found some completions"
|
|
||||||
|
|
||||||
# Return the success of having called _describe
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
__docker_debug "_describe did not find completions."
|
|
||||||
__docker_debug "Checking if we should do file completion."
|
|
||||||
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
|
|
||||||
__docker_debug "deactivating file completion"
|
|
||||||
|
|
||||||
# We must return an error code here to let zsh know that there were no
|
|
||||||
# completions found by _describe; this is what will trigger other
|
|
||||||
# matching algorithms to attempt to find completions.
|
|
||||||
# For example zsh can match letters in the middle of words.
|
|
||||||
return 1
|
|
||||||
else
|
|
||||||
# Perform file completion
|
|
||||||
__docker_debug "Activating file completion"
|
|
||||||
|
|
||||||
# We must return the result of this command, so it must be the
|
|
||||||
# last command, or else we must store its result to return it.
|
|
||||||
_arguments '*:filename:_files'" ${flagPrefix}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# don't run the completion function when being source-ed or eval-ed
|
|
||||||
if [ "$funcstack[1]" = "_docker" ]; then
|
|
||||||
_docker
|
|
||||||
fi
|
|
1677
dot_oh-my-zsh/cache/completions/_rustup
vendored
1677
dot_oh-my-zsh/cache/completions/_rustup
vendored
File diff suppressed because it is too large
Load diff
1
dot_oh-my-zsh/cache/dot_zsh-update
vendored
1
dot_oh-my-zsh/cache/dot_zsh-update
vendored
|
@ -1 +0,0 @@
|
||||||
LAST_EPOCH=20013
|
|
0
dot_oh-my-zsh/cache/empty_dot_gitkeep
vendored
0
dot_oh-my-zsh/cache/empty_dot_gitkeep
vendored
3
dot_oh-my-zsh/cache/grep-alias
vendored
3
dot_oh-my-zsh/cache/grep-alias
vendored
|
@ -1,3 +0,0 @@
|
||||||
alias grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox,.venv,venv}'
|
|
||||||
alias egrep='grep -E'
|
|
||||||
alias fgrep='grep -F'
|
|
8
dot_oh-my-zsh/cache/modules-6.11.1-arch1-1
vendored
8
dot_oh-my-zsh/cache/modules-6.11.1-arch1-1
vendored
File diff suppressed because one or more lines are too long
4
dot_oh-my-zsh/cache/python_modules
vendored
4
dot_oh-my-zsh/cache/python_modules
vendored
File diff suppressed because one or more lines are too long
18
dot_oh-my-zsh/cache/thefuck
vendored
18
dot_oh-my-zsh/cache/thefuck
vendored
|
@ -1,18 +0,0 @@
|
||||||
|
|
||||||
fuck () {
|
|
||||||
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
|
|
||||||
export TF_SHELL=zsh;
|
|
||||||
export TF_ALIAS=fuck;
|
|
||||||
TF_SHELL_ALIASES=$(alias);
|
|
||||||
export TF_SHELL_ALIASES;
|
|
||||||
TF_HISTORY="$(fc -ln -10)";
|
|
||||||
export TF_HISTORY;
|
|
||||||
export PYTHONIOENCODING=utf-8;
|
|
||||||
TF_CMD=$(
|
|
||||||
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
|
|
||||||
) && eval $TF_CMD;
|
|
||||||
unset TF_HISTORY;
|
|
||||||
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
|
|
||||||
test -n "$TF_CMD" && print -s $TF_CMD
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Put files in this folder to add your own custom functionality.
|
|
||||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization
|
|
||||||
#
|
|
||||||
# Files in the custom/ directory will be:
|
|
||||||
# - loaded automatically by the init script, in alphabetical order
|
|
||||||
# - loaded last, after all built-ins in the lib/ directory, to override them
|
|
||||||
# - ignored by git by default
|
|
||||||
#
|
|
||||||
# Example: add custom/shortcuts.zsh for shortcuts to your local projects
|
|
||||||
#
|
|
||||||
# brainstormr=~/Projects/development/planetargon/brainstormr
|
|
||||||
# cd $brainstormr
|
|
|
@ -1,3 +0,0 @@
|
||||||
# Add your own custom plugins in the custom/plugins directory. Plugins placed
|
|
||||||
# here will override ones with the same name in the main plugins directory.
|
|
||||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-plugins
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Put your custom themes in this folder.
|
|
||||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
|
|
||||||
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
|
|
|
@ -1,11 +0,0 @@
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
charset = utf-8
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
|
|
||||||
[*.py]
|
|
||||||
indent_size = 4
|
|
|
@ -1 +0,0 @@
|
||||||
1b5af717a987a58deda1873cb28e4b05ba26bba8 branch 'master' of https://github.com/ohmyzsh/ohmyzsh
|
|
|
@ -1 +0,0 @@
|
||||||
ref: refs/heads/master
|
|
|
@ -1 +0,0 @@
|
||||||
62cf1201b031399e7251abeee859e895ee825a48
|
|
|
@ -1,23 +0,0 @@
|
||||||
[core]
|
|
||||||
repositoryformatversion = 0
|
|
||||||
filemode = true
|
|
||||||
bare = false
|
|
||||||
logallrefupdates = true
|
|
||||||
eol = lf
|
|
||||||
autocrlf = false
|
|
||||||
[fsck]
|
|
||||||
zeroPaddedFilemode = ignore
|
|
||||||
[fetch "fsck"]
|
|
||||||
zeroPaddedFilemode = ignore
|
|
||||||
[receive "fsck"]
|
|
||||||
zeroPaddedFilemode = ignore
|
|
||||||
[oh-my-zsh]
|
|
||||||
remote = origin
|
|
||||||
branch = master
|
|
||||||
lastVersion = 62cf1201b031399e7251abeee859e895ee825a48
|
|
||||||
[remote "origin"]
|
|
||||||
url = https://github.com/ohmyzsh/ohmyzsh.git
|
|
||||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
||||||
[branch "master"]
|
|
||||||
remote = origin
|
|
||||||
merge = refs/heads/master
|
|
|
@ -1 +0,0 @@
|
||||||
Unnamed repository; edit this file 'description' to name the repository.
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to check the commit log message taken by
|
|
||||||
# applypatch from an e-mail message.
|
|
||||||
#
|
|
||||||
# The hook should exit with non-zero status after issuing an
|
|
||||||
# appropriate message if it wants to stop the commit. The hook is
|
|
||||||
# allowed to edit the commit message file.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "applypatch-msg".
|
|
||||||
|
|
||||||
. git-sh-setup
|
|
||||||
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
|
|
||||||
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
|
|
||||||
:
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to check the commit log message.
|
|
||||||
# Called by "git commit" with one argument, the name of the file
|
|
||||||
# that has the commit message. The hook should exit with non-zero
|
|
||||||
# status after issuing an appropriate message if it wants to stop the
|
|
||||||
# commit. The hook is allowed to edit the commit message file.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "commit-msg".
|
|
||||||
|
|
||||||
# Uncomment the below to add a Signed-off-by line to the message.
|
|
||||||
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
|
|
||||||
# hook is more suited to it.
|
|
||||||
#
|
|
||||||
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
|
|
||||||
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
|
|
||||||
|
|
||||||
# This example catches duplicate Signed-off-by lines.
|
|
||||||
|
|
||||||
test "" = "$(grep '^Signed-off-by: ' "$1" |
|
|
||||||
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
|
|
||||||
echo >&2 Duplicate Signed-off-by lines.
|
|
||||||
exit 1
|
|
||||||
}
|
|
|
@ -1,174 +0,0 @@
|
||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use IPC::Open2;
|
|
||||||
|
|
||||||
# An example hook script to integrate Watchman
|
|
||||||
# (https://facebook.github.io/watchman/) with git to speed up detecting
|
|
||||||
# new and modified files.
|
|
||||||
#
|
|
||||||
# The hook is passed a version (currently 2) and last update token
|
|
||||||
# formatted as a string and outputs to stdout a new update token and
|
|
||||||
# all files that have been modified since the update token. Paths must
|
|
||||||
# be relative to the root of the working tree and separated by a single NUL.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "query-watchman" and set
|
|
||||||
# 'git config core.fsmonitor .git/hooks/query-watchman'
|
|
||||||
#
|
|
||||||
my ($version, $last_update_token) = @ARGV;
|
|
||||||
|
|
||||||
# Uncomment for debugging
|
|
||||||
# print STDERR "$0 $version $last_update_token\n";
|
|
||||||
|
|
||||||
# Check the hook interface version
|
|
||||||
if ($version ne 2) {
|
|
||||||
die "Unsupported query-fsmonitor hook version '$version'.\n" .
|
|
||||||
"Falling back to scanning...\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
my $git_work_tree = get_working_dir();
|
|
||||||
|
|
||||||
my $retry = 1;
|
|
||||||
|
|
||||||
my $json_pkg;
|
|
||||||
eval {
|
|
||||||
require JSON::XS;
|
|
||||||
$json_pkg = "JSON::XS";
|
|
||||||
1;
|
|
||||||
} or do {
|
|
||||||
require JSON::PP;
|
|
||||||
$json_pkg = "JSON::PP";
|
|
||||||
};
|
|
||||||
|
|
||||||
launch_watchman();
|
|
||||||
|
|
||||||
sub launch_watchman {
|
|
||||||
my $o = watchman_query();
|
|
||||||
if (is_work_tree_watched($o)) {
|
|
||||||
output_result($o->{clock}, @{$o->{files}});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub output_result {
|
|
||||||
my ($clockid, @files) = @_;
|
|
||||||
|
|
||||||
# Uncomment for debugging watchman output
|
|
||||||
# open (my $fh, ">", ".git/watchman-output.out");
|
|
||||||
# binmode $fh, ":utf8";
|
|
||||||
# print $fh "$clockid\n@files\n";
|
|
||||||
# close $fh;
|
|
||||||
|
|
||||||
binmode STDOUT, ":utf8";
|
|
||||||
print $clockid;
|
|
||||||
print "\0";
|
|
||||||
local $, = "\0";
|
|
||||||
print @files;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub watchman_clock {
|
|
||||||
my $response = qx/watchman clock "$git_work_tree"/;
|
|
||||||
die "Failed to get clock id on '$git_work_tree'.\n" .
|
|
||||||
"Falling back to scanning...\n" if $? != 0;
|
|
||||||
|
|
||||||
return $json_pkg->new->utf8->decode($response);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub watchman_query {
|
|
||||||
my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty')
|
|
||||||
or die "open2() failed: $!\n" .
|
|
||||||
"Falling back to scanning...\n";
|
|
||||||
|
|
||||||
# In the query expression below we're asking for names of files that
|
|
||||||
# changed since $last_update_token but not from the .git folder.
|
|
||||||
#
|
|
||||||
# To accomplish this, we're using the "since" generator to use the
|
|
||||||
# recency index to select candidate nodes and "fields" to limit the
|
|
||||||
# output to file names only. Then we're using the "expression" term to
|
|
||||||
# further constrain the results.
|
|
||||||
my $last_update_line = "";
|
|
||||||
if (substr($last_update_token, 0, 1) eq "c") {
|
|
||||||
$last_update_token = "\"$last_update_token\"";
|
|
||||||
$last_update_line = qq[\n"since": $last_update_token,];
|
|
||||||
}
|
|
||||||
my $query = <<" END";
|
|
||||||
["query", "$git_work_tree", {$last_update_line
|
|
||||||
"fields": ["name"],
|
|
||||||
"expression": ["not", ["dirname", ".git"]]
|
|
||||||
}]
|
|
||||||
END
|
|
||||||
|
|
||||||
# Uncomment for debugging the watchman query
|
|
||||||
# open (my $fh, ">", ".git/watchman-query.json");
|
|
||||||
# print $fh $query;
|
|
||||||
# close $fh;
|
|
||||||
|
|
||||||
print CHLD_IN $query;
|
|
||||||
close CHLD_IN;
|
|
||||||
my $response = do {local $/; <CHLD_OUT>};
|
|
||||||
|
|
||||||
# Uncomment for debugging the watch response
|
|
||||||
# open ($fh, ">", ".git/watchman-response.json");
|
|
||||||
# print $fh $response;
|
|
||||||
# close $fh;
|
|
||||||
|
|
||||||
die "Watchman: command returned no output.\n" .
|
|
||||||
"Falling back to scanning...\n" if $response eq "";
|
|
||||||
die "Watchman: command returned invalid output: $response\n" .
|
|
||||||
"Falling back to scanning...\n" unless $response =~ /^\{/;
|
|
||||||
|
|
||||||
return $json_pkg->new->utf8->decode($response);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub is_work_tree_watched {
|
|
||||||
my ($output) = @_;
|
|
||||||
my $error = $output->{error};
|
|
||||||
if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
|
|
||||||
$retry--;
|
|
||||||
my $response = qx/watchman watch "$git_work_tree"/;
|
|
||||||
die "Failed to make watchman watch '$git_work_tree'.\n" .
|
|
||||||
"Falling back to scanning...\n" if $? != 0;
|
|
||||||
$output = $json_pkg->new->utf8->decode($response);
|
|
||||||
$error = $output->{error};
|
|
||||||
die "Watchman: $error.\n" .
|
|
||||||
"Falling back to scanning...\n" if $error;
|
|
||||||
|
|
||||||
# Uncomment for debugging watchman output
|
|
||||||
# open (my $fh, ">", ".git/watchman-output.out");
|
|
||||||
# close $fh;
|
|
||||||
|
|
||||||
# Watchman will always return all files on the first query so
|
|
||||||
# return the fast "everything is dirty" flag to git and do the
|
|
||||||
# Watchman query just to get it over with now so we won't pay
|
|
||||||
# the cost in git to look up each individual file.
|
|
||||||
my $o = watchman_clock();
|
|
||||||
$error = $output->{error};
|
|
||||||
|
|
||||||
die "Watchman: $error.\n" .
|
|
||||||
"Falling back to scanning...\n" if $error;
|
|
||||||
|
|
||||||
output_result($o->{clock}, ("/"));
|
|
||||||
$last_update_token = $o->{clock};
|
|
||||||
|
|
||||||
eval { launch_watchman() };
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
die "Watchman: $error.\n" .
|
|
||||||
"Falling back to scanning...\n" if $error;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_working_dir {
|
|
||||||
my $working_dir;
|
|
||||||
if ($^O =~ 'msys' || $^O =~ 'cygwin') {
|
|
||||||
$working_dir = Win32::GetCwd();
|
|
||||||
$working_dir =~ tr/\\/\//;
|
|
||||||
} else {
|
|
||||||
require Cwd;
|
|
||||||
$working_dir = Cwd::cwd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $working_dir;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to prepare a packed repository for use over
|
|
||||||
# dumb transports.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "post-update".
|
|
||||||
|
|
||||||
exec git update-server-info
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to verify what is about to be committed
|
|
||||||
# by applypatch from an e-mail message.
|
|
||||||
#
|
|
||||||
# The hook should exit with non-zero status after issuing an
|
|
||||||
# appropriate message if it wants to stop the commit.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "pre-applypatch".
|
|
||||||
|
|
||||||
. git-sh-setup
|
|
||||||
precommit="$(git rev-parse --git-path hooks/pre-commit)"
|
|
||||||
test -x "$precommit" && exec "$precommit" ${1+"$@"}
|
|
||||||
:
|
|
|
@ -1,49 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to verify what is about to be committed.
|
|
||||||
# Called by "git commit" with no arguments. The hook should
|
|
||||||
# exit with non-zero status after issuing an appropriate message if
|
|
||||||
# it wants to stop the commit.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "pre-commit".
|
|
||||||
|
|
||||||
if git rev-parse --verify HEAD >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
against=HEAD
|
|
||||||
else
|
|
||||||
# Initial commit: diff against an empty tree object
|
|
||||||
against=$(git hash-object -t tree /dev/null)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If you want to allow non-ASCII filenames set this variable to true.
|
|
||||||
allownonascii=$(git config --type=bool hooks.allownonascii)
|
|
||||||
|
|
||||||
# Redirect output to stderr.
|
|
||||||
exec 1>&2
|
|
||||||
|
|
||||||
# Cross platform projects tend to avoid non-ASCII filenames; prevent
|
|
||||||
# them from being added to the repository. We exploit the fact that the
|
|
||||||
# printable range starts at the space character and ends with tilde.
|
|
||||||
if [ "$allownonascii" != "true" ] &&
|
|
||||||
# Note that the use of brackets around a tr range is ok here, (it's
|
|
||||||
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
|
||||||
# the square bracket bytes happen to fall in the designated range.
|
|
||||||
test $(git diff-index --cached --name-only --diff-filter=A -z $against |
|
|
||||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
|
||||||
then
|
|
||||||
cat <<\EOF
|
|
||||||
Error: Attempt to add a non-ASCII file name.
|
|
||||||
|
|
||||||
This can cause problems if you want to work with people on other platforms.
|
|
||||||
|
|
||||||
To be portable it is advisable to rename the file.
|
|
||||||
|
|
||||||
If you know what you are doing you can disable this check using:
|
|
||||||
|
|
||||||
git config hooks.allownonascii true
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If there are whitespace errors, print the offending file names and fail.
|
|
||||||
exec git diff-index --check --cached $against --
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to verify what is about to be committed.
|
|
||||||
# Called by "git merge" with no arguments. The hook should
|
|
||||||
# exit with non-zero status after issuing an appropriate message to
|
|
||||||
# stderr if it wants to stop the merge commit.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "pre-merge-commit".
|
|
||||||
|
|
||||||
. git-sh-setup
|
|
||||||
test -x "$GIT_DIR/hooks/pre-commit" &&
|
|
||||||
exec "$GIT_DIR/hooks/pre-commit"
|
|
||||||
:
|
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# An example hook script to verify what is about to be pushed. Called by "git
|
|
||||||
# push" after it has checked the remote status, but before anything has been
|
|
||||||
# pushed. If this script exits with a non-zero status nothing will be pushed.
|
|
||||||
#
|
|
||||||
# This hook is called with the following parameters:
|
|
||||||
#
|
|
||||||
# $1 -- Name of the remote to which the push is being done
|
|
||||||
# $2 -- URL to which the push is being done
|
|
||||||
#
|
|
||||||
# If pushing without using a named remote those arguments will be equal.
|
|
||||||
#
|
|
||||||
# Information about the commits which are being pushed is supplied as lines to
|
|
||||||
# the standard input in the form:
|
|
||||||
#
|
|
||||||
# <local ref> <local oid> <remote ref> <remote oid>
|
|
||||||
#
|
|
||||||
# This sample shows how to prevent push of commits where the log message starts
|
|
||||||
# with "WIP" (work in progress).
|
|
||||||
|
|
||||||
remote="$1"
|
|
||||||
url="$2"
|
|
||||||
|
|
||||||
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
|
|
||||||
|
|
||||||
while read local_ref local_oid remote_ref remote_oid
|
|
||||||
do
|
|
||||||
if test "$local_oid" = "$zero"
|
|
||||||
then
|
|
||||||
# Handle delete
|
|
||||||
:
|
|
||||||
else
|
|
||||||
if test "$remote_oid" = "$zero"
|
|
||||||
then
|
|
||||||
# New branch, examine all commits
|
|
||||||
range="$local_oid"
|
|
||||||
else
|
|
||||||
# Update to existing branch, examine new commits
|
|
||||||
range="$remote_oid..$local_oid"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for WIP commit
|
|
||||||
commit=$(git rev-list -n 1 --grep '^WIP' "$range")
|
|
||||||
if test -n "$commit"
|
|
||||||
then
|
|
||||||
echo >&2 "Found WIP commit in $local_ref, not pushing"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,169 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006, 2008 Junio C Hamano
|
|
||||||
#
|
|
||||||
# The "pre-rebase" hook is run just before "git rebase" starts doing
|
|
||||||
# its job, and can prevent the command from running by exiting with
|
|
||||||
# non-zero status.
|
|
||||||
#
|
|
||||||
# The hook is called with the following parameters:
|
|
||||||
#
|
|
||||||
# $1 -- the upstream the series was forked from.
|
|
||||||
# $2 -- the branch being rebased (or empty when rebasing the current branch).
|
|
||||||
#
|
|
||||||
# This sample shows how to prevent topic branches that are already
|
|
||||||
# merged to 'next' branch from getting rebased, because allowing it
|
|
||||||
# would result in rebasing already published history.
|
|
||||||
|
|
||||||
publish=next
|
|
||||||
basebranch="$1"
|
|
||||||
if test "$#" = 2
|
|
||||||
then
|
|
||||||
topic="refs/heads/$2"
|
|
||||||
else
|
|
||||||
topic=`git symbolic-ref HEAD` ||
|
|
||||||
exit 0 ;# we do not interrupt rebasing detached HEAD
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$topic" in
|
|
||||||
refs/heads/??/*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 0 ;# we do not interrupt others.
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Now we are dealing with a topic branch being rebased
|
|
||||||
# on top of master. Is it OK to rebase it?
|
|
||||||
|
|
||||||
# Does the topic really exist?
|
|
||||||
git show-ref -q "$topic" || {
|
|
||||||
echo >&2 "No such branch $topic"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Is topic fully merged to master?
|
|
||||||
not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
|
|
||||||
if test -z "$not_in_master"
|
|
||||||
then
|
|
||||||
echo >&2 "$topic is fully merged to master; better remove it."
|
|
||||||
exit 1 ;# we could allow it, but there is no point.
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Is topic ever merged to next? If so you should not be rebasing it.
|
|
||||||
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
|
|
||||||
only_next_2=`git rev-list ^master ${publish} | sort`
|
|
||||||
if test "$only_next_1" = "$only_next_2"
|
|
||||||
then
|
|
||||||
not_in_topic=`git rev-list "^$topic" master`
|
|
||||||
if test -z "$not_in_topic"
|
|
||||||
then
|
|
||||||
echo >&2 "$topic is already up to date with master"
|
|
||||||
exit 1 ;# we could allow it, but there is no point.
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
|
|
||||||
/usr/bin/perl -e '
|
|
||||||
my $topic = $ARGV[0];
|
|
||||||
my $msg = "* $topic has commits already merged to public branch:\n";
|
|
||||||
my (%not_in_next) = map {
|
|
||||||
/^([0-9a-f]+) /;
|
|
||||||
($1 => 1);
|
|
||||||
} split(/\n/, $ARGV[1]);
|
|
||||||
for my $elem (map {
|
|
||||||
/^([0-9a-f]+) (.*)$/;
|
|
||||||
[$1 => $2];
|
|
||||||
} split(/\n/, $ARGV[2])) {
|
|
||||||
if (!exists $not_in_next{$elem->[0]}) {
|
|
||||||
if ($msg) {
|
|
||||||
print STDERR $msg;
|
|
||||||
undef $msg;
|
|
||||||
}
|
|
||||||
print STDERR " $elem->[1]\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
' "$topic" "$not_in_next" "$not_in_master"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
<<\DOC_END
|
|
||||||
|
|
||||||
This sample hook safeguards topic branches that have been
|
|
||||||
published from being rewound.
|
|
||||||
|
|
||||||
The workflow assumed here is:
|
|
||||||
|
|
||||||
* Once a topic branch forks from "master", "master" is never
|
|
||||||
merged into it again (either directly or indirectly).
|
|
||||||
|
|
||||||
* Once a topic branch is fully cooked and merged into "master",
|
|
||||||
it is deleted. If you need to build on top of it to correct
|
|
||||||
earlier mistakes, a new topic branch is created by forking at
|
|
||||||
the tip of the "master". This is not strictly necessary, but
|
|
||||||
it makes it easier to keep your history simple.
|
|
||||||
|
|
||||||
* Whenever you need to test or publish your changes to topic
|
|
||||||
branches, merge them into "next" branch.
|
|
||||||
|
|
||||||
The script, being an example, hardcodes the publish branch name
|
|
||||||
to be "next", but it is trivial to make it configurable via
|
|
||||||
$GIT_DIR/config mechanism.
|
|
||||||
|
|
||||||
With this workflow, you would want to know:
|
|
||||||
|
|
||||||
(1) ... if a topic branch has ever been merged to "next". Young
|
|
||||||
topic branches can have stupid mistakes you would rather
|
|
||||||
clean up before publishing, and things that have not been
|
|
||||||
merged into other branches can be easily rebased without
|
|
||||||
affecting other people. But once it is published, you would
|
|
||||||
not want to rewind it.
|
|
||||||
|
|
||||||
(2) ... if a topic branch has been fully merged to "master".
|
|
||||||
Then you can delete it. More importantly, you should not
|
|
||||||
build on top of it -- other people may already want to
|
|
||||||
change things related to the topic as patches against your
|
|
||||||
"master", so if you need further changes, it is better to
|
|
||||||
fork the topic (perhaps with the same name) afresh from the
|
|
||||||
tip of "master".
|
|
||||||
|
|
||||||
Let's look at this example:
|
|
||||||
|
|
||||||
o---o---o---o---o---o---o---o---o---o "next"
|
|
||||||
/ / / /
|
|
||||||
/ a---a---b A / /
|
|
||||||
/ / / /
|
|
||||||
/ / c---c---c---c B /
|
|
||||||
/ / / \ /
|
|
||||||
/ / / b---b C \ /
|
|
||||||
/ / / / \ /
|
|
||||||
---o---o---o---o---o---o---o---o---o---o---o "master"
|
|
||||||
|
|
||||||
|
|
||||||
A, B and C are topic branches.
|
|
||||||
|
|
||||||
* A has one fix since it was merged up to "next".
|
|
||||||
|
|
||||||
* B has finished. It has been fully merged up to "master" and "next",
|
|
||||||
and is ready to be deleted.
|
|
||||||
|
|
||||||
* C has not merged to "next" at all.
|
|
||||||
|
|
||||||
We would want to allow C to be rebased, refuse A, and encourage
|
|
||||||
B to be deleted.
|
|
||||||
|
|
||||||
To compute (1):
|
|
||||||
|
|
||||||
git rev-list ^master ^topic next
|
|
||||||
git rev-list ^master next
|
|
||||||
|
|
||||||
if these match, topic has not merged in next at all.
|
|
||||||
|
|
||||||
To compute (2):
|
|
||||||
|
|
||||||
git rev-list master..topic
|
|
||||||
|
|
||||||
if this is empty, it is fully merged to "master".
|
|
||||||
|
|
||||||
DOC_END
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to make use of push options.
|
|
||||||
# The example simply echoes all push options that start with 'echoback='
|
|
||||||
# and rejects all pushes when the "reject" push option is used.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "pre-receive".
|
|
||||||
|
|
||||||
if test -n "$GIT_PUSH_OPTION_COUNT"
|
|
||||||
then
|
|
||||||
i=0
|
|
||||||
while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
|
|
||||||
do
|
|
||||||
eval "value=\$GIT_PUSH_OPTION_$i"
|
|
||||||
case "$value" in
|
|
||||||
echoback=*)
|
|
||||||
echo "echo from the pre-receive-hook: ${value#*=}" >&2
|
|
||||||
;;
|
|
||||||
reject)
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
i=$((i + 1))
|
|
||||||
done
|
|
||||||
fi
|
|
|
@ -1,42 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to prepare the commit log message.
|
|
||||||
# Called by "git commit" with the name of the file that has the
|
|
||||||
# commit message, followed by the description of the commit
|
|
||||||
# message's source. The hook's purpose is to edit the commit
|
|
||||||
# message file. If the hook fails with a non-zero status,
|
|
||||||
# the commit is aborted.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "prepare-commit-msg".
|
|
||||||
|
|
||||||
# This hook includes three examples. The first one removes the
|
|
||||||
# "# Please enter the commit message..." help message.
|
|
||||||
#
|
|
||||||
# The second includes the output of "git diff --name-status -r"
|
|
||||||
# into the message, just before the "git status" output. It is
|
|
||||||
# commented because it doesn't cope with --amend or with squashed
|
|
||||||
# commits.
|
|
||||||
#
|
|
||||||
# The third example adds a Signed-off-by line to the message, that can
|
|
||||||
# still be edited. This is rarely a good idea.
|
|
||||||
|
|
||||||
COMMIT_MSG_FILE=$1
|
|
||||||
COMMIT_SOURCE=$2
|
|
||||||
SHA1=$3
|
|
||||||
|
|
||||||
/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"
|
|
||||||
|
|
||||||
# case "$COMMIT_SOURCE,$SHA1" in
|
|
||||||
# ,|template,)
|
|
||||||
# /usr/bin/perl -i.bak -pe '
|
|
||||||
# print "\n" . `git diff --cached --name-status -r`
|
|
||||||
# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;;
|
|
||||||
# *) ;;
|
|
||||||
# esac
|
|
||||||
|
|
||||||
# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
|
|
||||||
# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE"
|
|
||||||
# if test -z "$COMMIT_SOURCE"
|
|
||||||
# then
|
|
||||||
# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE"
|
|
||||||
# fi
|
|
|
@ -1,78 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# An example hook script to update a checked-out tree on a git push.
|
|
||||||
#
|
|
||||||
# This hook is invoked by git-receive-pack(1) when it reacts to git
|
|
||||||
# push and updates reference(s) in its repository, and when the push
|
|
||||||
# tries to update the branch that is currently checked out and the
|
|
||||||
# receive.denyCurrentBranch configuration variable is set to
|
|
||||||
# updateInstead.
|
|
||||||
#
|
|
||||||
# By default, such a push is refused if the working tree and the index
|
|
||||||
# of the remote repository has any difference from the currently
|
|
||||||
# checked out commit; when both the working tree and the index match
|
|
||||||
# the current commit, they are updated to match the newly pushed tip
|
|
||||||
# of the branch. This hook is to be used to override the default
|
|
||||||
# behaviour; however the code below reimplements the default behaviour
|
|
||||||
# as a starting point for convenient modification.
|
|
||||||
#
|
|
||||||
# The hook receives the commit with which the tip of the current
|
|
||||||
# branch is going to be updated:
|
|
||||||
commit=$1
|
|
||||||
|
|
||||||
# It can exit with a non-zero status to refuse the push (when it does
|
|
||||||
# so, it must not modify the index or the working tree).
|
|
||||||
die () {
|
|
||||||
echo >&2 "$*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Or it can make any necessary changes to the working tree and to the
|
|
||||||
# index to bring them to the desired state when the tip of the current
|
|
||||||
# branch is updated to the new commit, and exit with a zero status.
|
|
||||||
#
|
|
||||||
# For example, the hook can simply run git read-tree -u -m HEAD "$1"
|
|
||||||
# in order to emulate git fetch that is run in the reverse direction
|
|
||||||
# with git push, as the two-tree form of git read-tree -u -m is
|
|
||||||
# essentially the same as git switch or git checkout that switches
|
|
||||||
# branches while keeping the local changes in the working tree that do
|
|
||||||
# not interfere with the difference between the branches.
|
|
||||||
|
|
||||||
# The below is a more-or-less exact translation to shell of the C code
|
|
||||||
# for the default behaviour for git's push-to-checkout hook defined in
|
|
||||||
# the push_to_deploy() function in builtin/receive-pack.c.
|
|
||||||
#
|
|
||||||
# Note that the hook will be executed from the repository directory,
|
|
||||||
# not from the working tree, so if you want to perform operations on
|
|
||||||
# the working tree, you will have to adapt your code accordingly, e.g.
|
|
||||||
# by adding "cd .." or using relative paths.
|
|
||||||
|
|
||||||
if ! git update-index -q --ignore-submodules --refresh
|
|
||||||
then
|
|
||||||
die "Up-to-date check failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! git diff-files --quiet --ignore-submodules --
|
|
||||||
then
|
|
||||||
die "Working directory has unstaged changes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This is a rough translation of:
|
|
||||||
#
|
|
||||||
# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX
|
|
||||||
if git cat-file -e HEAD 2>/dev/null
|
|
||||||
then
|
|
||||||
head=HEAD
|
|
||||||
else
|
|
||||||
head=$(git hash-object -t tree --stdin </dev/null)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! git diff-index --quiet --cached --ignore-submodules $head --
|
|
||||||
then
|
|
||||||
die "Working directory has staged changes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! git read-tree -u -m "$commit"
|
|
||||||
then
|
|
||||||
die "Could not update working tree to new HEAD"
|
|
||||||
fi
|
|
|
@ -1,77 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# An example hook script to validate a patch (and/or patch series) before
|
|
||||||
# sending it via email.
|
|
||||||
#
|
|
||||||
# The hook should exit with non-zero status after issuing an appropriate
|
|
||||||
# message if it wants to prevent the email(s) from being sent.
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "sendemail-validate".
|
|
||||||
#
|
|
||||||
# By default, it will only check that the patch(es) can be applied on top of
|
|
||||||
# the default upstream branch without conflicts in a secondary worktree. After
|
|
||||||
# validation (successful or not) of the last patch of a series, the worktree
|
|
||||||
# will be deleted.
|
|
||||||
#
|
|
||||||
# The following config variables can be set to change the default remote and
|
|
||||||
# remote ref that are used to apply the patches against:
|
|
||||||
#
|
|
||||||
# sendemail.validateRemote (default: origin)
|
|
||||||
# sendemail.validateRemoteRef (default: HEAD)
|
|
||||||
#
|
|
||||||
# Replace the TODO placeholders with appropriate checks according to your
|
|
||||||
# needs.
|
|
||||||
|
|
||||||
validate_cover_letter () {
|
|
||||||
file="$1"
|
|
||||||
# TODO: Replace with appropriate checks (e.g. spell checking).
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_patch () {
|
|
||||||
file="$1"
|
|
||||||
# Ensure that the patch applies without conflicts.
|
|
||||||
git am -3 "$file" || return
|
|
||||||
# TODO: Replace with appropriate checks for this patch
|
|
||||||
# (e.g. checkpatch.pl).
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_series () {
|
|
||||||
# TODO: Replace with appropriate checks for the whole series
|
|
||||||
# (e.g. quick build, coding style checks, etc.).
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
# main -------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if test "$GIT_SENDEMAIL_FILE_COUNTER" = 1
|
|
||||||
then
|
|
||||||
remote=$(git config --default origin --get sendemail.validateRemote) &&
|
|
||||||
ref=$(git config --default HEAD --get sendemail.validateRemoteRef) &&
|
|
||||||
worktree=$(mktemp --tmpdir -d sendemail-validate.XXXXXXX) &&
|
|
||||||
git worktree add -fd --checkout "$worktree" "refs/remotes/$remote/$ref" &&
|
|
||||||
git config --replace-all sendemail.validateWorktree "$worktree"
|
|
||||||
else
|
|
||||||
worktree=$(git config --get sendemail.validateWorktree)
|
|
||||||
fi || {
|
|
||||||
echo "sendemail-validate: error: failed to prepare worktree" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
unset GIT_DIR GIT_WORK_TREE
|
|
||||||
cd "$worktree" &&
|
|
||||||
|
|
||||||
if grep -q "^diff --git " "$1"
|
|
||||||
then
|
|
||||||
validate_patch "$1"
|
|
||||||
else
|
|
||||||
validate_cover_letter "$1"
|
|
||||||
fi &&
|
|
||||||
|
|
||||||
if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL"
|
|
||||||
then
|
|
||||||
git config --unset-all sendemail.validateWorktree &&
|
|
||||||
trap 'git worktree remove -ff "$worktree"' EXIT &&
|
|
||||||
validate_series
|
|
||||||
fi
|
|
|
@ -1,128 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# An example hook script to block unannotated tags from entering.
|
|
||||||
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
|
|
||||||
#
|
|
||||||
# To enable this hook, rename this file to "update".
|
|
||||||
#
|
|
||||||
# Config
|
|
||||||
# ------
|
|
||||||
# hooks.allowunannotated
|
|
||||||
# This boolean sets whether unannotated tags will be allowed into the
|
|
||||||
# repository. By default they won't be.
|
|
||||||
# hooks.allowdeletetag
|
|
||||||
# This boolean sets whether deleting tags will be allowed in the
|
|
||||||
# repository. By default they won't be.
|
|
||||||
# hooks.allowmodifytag
|
|
||||||
# This boolean sets whether a tag may be modified after creation. By default
|
|
||||||
# it won't be.
|
|
||||||
# hooks.allowdeletebranch
|
|
||||||
# This boolean sets whether deleting branches will be allowed in the
|
|
||||||
# repository. By default they won't be.
|
|
||||||
# hooks.denycreatebranch
|
|
||||||
# This boolean sets whether remotely creating branches will be denied
|
|
||||||
# in the repository. By default this is allowed.
|
|
||||||
#
|
|
||||||
|
|
||||||
# --- Command line
|
|
||||||
refname="$1"
|
|
||||||
oldrev="$2"
|
|
||||||
newrev="$3"
|
|
||||||
|
|
||||||
# --- Safety check
|
|
||||||
if [ -z "$GIT_DIR" ]; then
|
|
||||||
echo "Don't run this script from the command line." >&2
|
|
||||||
echo " (if you want, you could supply GIT_DIR then run" >&2
|
|
||||||
echo " $0 <ref> <oldrev> <newrev>)" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
|
|
||||||
echo "usage: $0 <ref> <oldrev> <newrev>" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Config
|
|
||||||
allowunannotated=$(git config --type=bool hooks.allowunannotated)
|
|
||||||
allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
|
|
||||||
denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
|
|
||||||
allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
|
|
||||||
allowmodifytag=$(git config --type=bool hooks.allowmodifytag)
|
|
||||||
|
|
||||||
# check for no description
|
|
||||||
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
|
|
||||||
case "$projectdesc" in
|
|
||||||
"Unnamed repository"* | "")
|
|
||||||
echo "*** Project description file hasn't been set" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# --- Check types
|
|
||||||
# if $newrev is 0000...0000, it's a commit to delete a ref.
|
|
||||||
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
|
|
||||||
if [ "$newrev" = "$zero" ]; then
|
|
||||||
newrev_type=delete
|
|
||||||
else
|
|
||||||
newrev_type=$(git cat-file -t $newrev)
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$refname","$newrev_type" in
|
|
||||||
refs/tags/*,commit)
|
|
||||||
# un-annotated tag
|
|
||||||
short_refname=${refname##refs/tags/}
|
|
||||||
if [ "$allowunannotated" != "true" ]; then
|
|
||||||
echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
|
|
||||||
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
refs/tags/*,delete)
|
|
||||||
# delete tag
|
|
||||||
if [ "$allowdeletetag" != "true" ]; then
|
|
||||||
echo "*** Deleting a tag is not allowed in this repository" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
refs/tags/*,tag)
|
|
||||||
# annotated tag
|
|
||||||
if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
|
|
||||||
then
|
|
||||||
echo "*** Tag '$refname' already exists." >&2
|
|
||||||
echo "*** Modifying a tag is not allowed in this repository." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
refs/heads/*,commit)
|
|
||||||
# branch
|
|
||||||
if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
|
|
||||||
echo "*** Creating a branch is not allowed in this repository" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
refs/heads/*,delete)
|
|
||||||
# delete branch
|
|
||||||
if [ "$allowdeletebranch" != "true" ]; then
|
|
||||||
echo "*** Deleting a branch is not allowed in this repository" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
refs/remotes/*,commit)
|
|
||||||
# tracking branch
|
|
||||||
;;
|
|
||||||
refs/remotes/*,delete)
|
|
||||||
# delete tracking branch
|
|
||||||
if [ "$allowdeletebranch" != "true" ]; then
|
|
||||||
echo "*** Deleting a tracking branch is not allowed in this repository" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# Anything else (is there anything else?)
|
|
||||||
echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# --- Finished
|
|
||||||
exit 0
|
|
Binary file not shown.
|
@ -1,6 +0,0 @@
|
||||||
# git ls-files --others --exclude-from=.git/info/exclude
|
|
||||||
# Lines that start with '#' are comments.
|
|
||||||
# For a project mostly in C, the following would be a good set of
|
|
||||||
# exclude patterns (uncomment them if you want to use them):
|
|
||||||
# *.[oa]
|
|
||||||
# *~
|
|
|
@ -1,4 +0,0 @@
|
||||||
0000000000000000000000000000000000000000 62cf1201b031399e7251abeee859e895ee825a48 yt <yt@ytlinux.(none)> 1728008061 -0400 checkout: moving from main to master
|
|
||||||
62cf1201b031399e7251abeee859e895ee825a48 62cf1201b031399e7251abeee859e895ee825a48 Cy Pokhrel <cy@cy7.sh> 1729123966 -0400 checkout: moving from master to master
|
|
||||||
62cf1201b031399e7251abeee859e895ee825a48 1b5af717a987a58deda1873cb28e4b05ba26bba8 Cy Pokhrel <cy@cy7.sh> 1729123967 -0400 pull --quiet --rebase origin master: Fast-forward
|
|
||||||
1b5af717a987a58deda1873cb28e4b05ba26bba8 1b5af717a987a58deda1873cb28e4b05ba26bba8 Cy Pokhrel <cy@cy7.sh> 1729123967 -0400 checkout: moving from master to master
|
|
|
@ -1,2 +0,0 @@
|
||||||
0000000000000000000000000000000000000000 62cf1201b031399e7251abeee859e895ee825a48 yt <yt@ytlinux.(none)> 1728008061 -0400 branch: Created from origin/master
|
|
||||||
62cf1201b031399e7251abeee859e895ee825a48 1b5af717a987a58deda1873cb28e4b05ba26bba8 Cy Pokhrel <cy@cy7.sh> 1729123967 -0400 pull --quiet --rebase origin master: Fast-forward
|
|
|
@ -1,2 +0,0 @@
|
||||||
0000000000000000000000000000000000000000 62cf1201b031399e7251abeee859e895ee825a48 yt <yt@ytlinux.(none)> 1728008061 -0400 fetch --depth=1 origin: storing head
|
|
||||||
62cf1201b031399e7251abeee859e895ee825a48 1b5af717a987a58deda1873cb28e4b05ba26bba8 Cy Pokhrel <cy@cy7.sh> 1729123967 -0400 pull --quiet --rebase origin master: fast-forward
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +0,0 @@
|
||||||
xm“I¯£F…³FÊ()›n!‡ÂSë%zƒ'&ÛØ«. l&3ØÆ¿>î´’MrWç\éHWG÷‹›ª*À²¼øËÐ GrœF±Ì 1›�Xˆ0’‰l‚c^¡€Åˆ©w¤À³PN8ˆS‚pÄ
|
|
||||||
ËHˆ9(â(æ’9Fa4Ç …Ç!o: ”ä ¼¦'uJÊ|à·ïþ±,üÌ*\”¿ÇMõ'`Ź„XAà%0ƒBê½};�˜Å°#ðQ7iËé3+†|Œþ£áüËÚ¬/20û1ê´¶À1à[æV öÞâï=(ðè�XUUSWuíZ=�¾æi,vÅqä÷y©(JgAWQ7šñ\jççy7Ñnà¤jG
|
|
||||||
túóÂ¥[ñLGui¨ëðV)ôn„ý¦ºKÇ2õÕ2á&8+S
|
|
||||||
wk3¹Ù´5$ôX–,±(×G|õÓºmTègyíY«Âå£è¹Š+ç¼é•cÚò<^?>µ:yÜ^â»ù½þ�ìm@ûÐɉ™ëòºZ°êJš�&-ÅÅÈÓž|†Í£¦Ü¾”‰jØ!¯7ÅÍEÎ9d”¹ÉOšÑ«w·u¾F�Ôë¿óû˜ßøîjW[î�…1ʽh´}íjjº§»g�¹ÊmhÚœÅ$§ÀsÃòû(¿øãFj—QZ.D»:Ñv»–vì³ÍÕ�¼÷s>Z:#j„ e…c\vûôD�j¯JóA4û%K¥ÌÉõývµ*fdËF*äLZqŠrêÑOg¯…¸â•¼q°¯¨÷còOš5<í…%›6ja^lÓP…¥É·kQ]´[¬‹Ãý\”Œ½vã‹$´tf$»Ñ=xDÌs$IƼ"SõOô~îr(Å×Bl¥—Á:‡—i¬w׊ë·Á¸“‚‘;ijÙØÔ®"D�õiŽ_DktS½÷êàfA{´,f}Žæ« x>Lérd&£‹F Ò«C[ÃPAN)·w“Br:úJâTEâ«^»ÚÝwAߘ6¹�2í™7eÛ÷B>Ø:¼¹j} ƒwf£ßj
|
|
||||||
Е£Á2m›;í
LÝÂÅž(þãBýdb±ÕÿŸ*-ž_Ú†Ý4#õýë7ÐÔ庱߂㡸ã�|E
|
|
||||||
jB’€/¿±s²_)Jkf?‰'É,š¾
we|\bðÿÐý[fŸm×Mý/ó¿R€¢mô
|
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
x•Ž;N1‰}ŠÎ‘Pûo#´Z’À ÚFš±GÞÞ€Ûc@VzA½Ê}ßWeã�R@[ïµÂ •ÆÖd\)>9¹$E�¬C
hÄA£4GÉ,Ž4¢I:L)×j5Öès´™+•_Ýø«x¡±uø �à)ÿòuâçù�{ÛiÝrßO ½
|
|
||||||
FÊ÷¨Å\g'—T”qåï<¸58Fa^§¬7˜§
Þ/ϯoñĘRÄ
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
x5ŽÉ
|
|
||||||
Â0E]ç+.¸iAR\þ…;Ò!5c_H^õëM–‡;žÛv·Çã”|¾Ó¢ÔÅÑÐOSÂÈÏà/H9Ž‚™#ÄY\KðV9‘�º¦)0zÒĵ.5Œœ,H[L
„?±ïTBc¿‚¬œ#^ÉÅ3yÛ)eŒ)¬~Îs¥µÞ^Ö› Þã$>
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
x•Ž]JĹ0F}Î*ćQ$M&Á%¸‚i:ą-4MIÇwo7ŕŰá�ďpr«u°qz�ÎŃ“¶ä˝Ë†ŰšQ»čC,Ö şÉ»dĂŚę¤Î‡€¦PgŇ!Úâp ÉNKÉČ1LČ)•ńƤčKÖÖá�úŢŕ“v‚×üË×ŔűűŮ›´ŁŇ¶żäVßŔD‹Ţ�„žµŐZŤut
|
|
||||||
˙Ó`“Á?�*Lňxßäé´,ŔW¦“a%É+H>hŢčú>2ŚžzŠúÇ^XL
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
x=Ž±
|
|
||||||
Â0„�ó.4�,89 nº‰�4MÍ1)IJ©OoªÕíŽ;¾»ÚúÛÝ~±\⢤Ճq<ŸÐÙþAŽ±«¡8Ȧ‰PþÙY�È;´>àÕp_™”ºX•åƒ’ékž;eœi±Q–Š5’Ñã)]KNƒ\Ò¡•Jx¿<O{ô1çi=-Cä%�ä?„ï½B>L£ï^Ñ…–¬®BdÏææaÅ9GFSÀÞ¥ÏUU
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
x+)JMU026e040031QHI-HÍKIÍKÎL-Ö«ÌÍaÈ)n瘖}¦8/PÓ·êÚ‰Ý�EÎÊ&@€¢”aë =¯zÕü›ÖXÜánמ¡´óh>ÔÈ̼â’ÄœœÔ"°y¡“OŠÇ;êñgýñ¶Y¡±ê×÷Móàê¾|ì;¼NäYP$WnX×fž‚ÉÝ^PÃr3óÀæ¨y–·�6þ»°õç^ýwYÜBí j
|
|
||||||
Šò³R“KÀÊt´dn¿¨tSïøs·/™›}9‹h¦\÷
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue