1
0
Fork 0

Merging upstream version 0.15.7.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-11 18:44:38 +01:00
parent 95bdcb5aa6
commit 83fc50a933
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 324 additions and 206 deletions

View file

@ -57,9 +57,11 @@ See the [customization section](#custom).
The additional status symbols denote
- `+`: staged changes
- `*`: unstaged changes
- `_`: untracked files/folders
symbol | meaning
---|---
`+`| staged changes
`*`| unstaged changes
`_`| untracked files/folders
The bookkeeping sub-commands are
@ -67,21 +69,22 @@ The bookkeeping sub-commands are
- `gita add -a <repo-parent-path(s)>`: add repo(s) in <repo-parent-path(s)> recursively
and automatically generate hierarchical groups. See the [customization section](#custom) for more details.
- `gita add -b <bare-repo-path(s)>`: add bare repo(s) to `gita`. See the [customization section](#custom) for more details on setting custom worktree.
- `gita add -m <main-repo-path(s)>`: add main repo(s) to `gita`. See the [customization section](#custom) for more details.
- `gita add -r <repo-parent-path(s)>`: add repo(s) in <repo-parent-path(s)> recursively
- `gita clone <config-file>`: clone repos in `config-file` (generated by `gita freeze`) to current directory.
- `gita clone -p <config-file>`: clone repos in `config-file` to prescribed paths.
- `gita context`: context sub-command
- `gita context`: show current context
- `gita context none`: remove context
- `gita context <group-name>`: set context to `group-name`, all operations then only apply to repos in this group
- `gita context auto`: set context automatically according to the current working directory
- `gita context none`: remove context
- `gita color`: color sub-command
- `gita color [ll]`: Show available colors and the current coloring scheme
- `gita color set <situation> <color>`: Use the specified color for the local-remote situation
- `gita flags`: flags sub-command
- `gita flags set <repo-name> <flags>`: add custom `flags` to repo
- `gita flags [ll]`: display repos with custom flags
- `gita freeze`: print information of all repos such as URL, name, and path.
- `gita freeze`: print information of all repos such as URL, name, and path. Use with
`gita clone`.
- `gita group`: group sub-command
- `gita group add <repo-name(s)> -n <group-name>`: add repo(s) to a new or existing group
- `gita group [ll]`: display existing groups with repos
@ -95,6 +98,7 @@ The bookkeeping sub-commands are
- `gita info rm <info-item>`: disable information item
- `gita ll`: display the status of all repos
- `gita ll <group-name>`: display the status of repos in a group
- `gita ll -g`: display the repo summaries by groups
- `gita ls`: display the names of all repos
- `gita ls <repo-name>`: display the absolute path of one repo
- `gita rename <repo-name> <new-name>`: rename a repo
@ -211,6 +215,20 @@ gita ll
gita pull
```
The most useful context maybe `auto`.
In this mode, the context is automatically determined from the
current working directory (CWD): the context is the group whose member repo's
path contains CWD. To set it, run
```
gita context auto
```
To remove the context, run
```
gita context none
```
It is also possible to recursively add repos within a directory and
generate hierarchical groups automatically. For example, running
@ -229,41 +247,13 @@ src
│   └── repo5
└── repo6
```
gives rise to
gives rise to 3 groups:
```
src:repo1,repo2,repo3,repo4,repo5,repo6
src-project1:repo1,repo2
src-project2:repo4,repo5
```
### define main repos and shadow the global configuration setting with local setting
The so-called main repos contain `.gita` folder for local configurations.
It works best for the repos-within-repo project structure, for example,
```
main-repo
├── sub-repo1
│   └── sub-sub-repo
├── sub-repo2
└── sub-repo3
```
When executing `gita` commands within/relative to a main repo, local configurations
are used. And only repos within the current main repos are in the scope.
To add a main repo, run
```
gita add -m main-repo-path
```
Subordinate repos are added recursively to the local configuration.
Only the main repo is saved to the global configuration.
In the `gita ll` display, the main repos are underlined.
### add user-defined sub-command using json file
Custom delegating sub-commands can be defined in `$XDG_CONFIG_HOME/gita/cmds.json`
@ -341,21 +331,24 @@ branch,commit_msg,commit_time
### customize git command flags
One can set custom flags to run `git` commands. For example
One can set custom flags to run `git` commands. For example, with
```
gita flags set my-repo --git-dir=$HOME/somefolder --work-tree=$HOME
gita flags set my-repo --git-dir=`gita ls dotfiles` --work-tree=$HOME
```
Then any `git` command/alias triggered from `gita` on `my-repo` will use these flags.
any `git` command/alias triggered from `gita` on `dotfiles` will use these flags.
Note that the flags are applied immediately after `git`. For example,
`gita st my-repo` translates to
`gita st dotfiles` translates to
```
git --git-dir=$HOME/somefolder --work-tree=$HOME status
```
running from the `my-repo` directory.
running from the `dotfiles` directory.
This feature was originally added to deal with
[bare repo dotfiles](https://www.atlassian.com/git/tutorials/dotfiles).
## Requirements