Comments (8)
By 'context', do you mean the one in gita context
, which can be set to a group name or 'auto' or 'none'? When set, only repos in the context will be shown or act on.
Or maybe you just want to start brand new?
In the latter case, you can delete two files in ~/.config/gita/
: groups.csv
and repos.csv
from gita.
By context I mean working workspace rather than gita's context. I will use workspace instead of context to avoid terminology overlapping.
I could have several tens or hundred of workspaces with a few potential groups and repos. In this scenarios, always having them all in gita, would be a hard thing to manage. Think of only running an gita group
command. One could search through a full screen of groups for the desired one.
The proposed conceptual workflow is that when moving to a new workspace directory, that contains several groups and projects it is desirable to start with a clean gita by running a gita rm *
or gita clear
and than simply run a gita add -a .
to populate Gita with only desirable ones. That way all becomes simplified and focused on the current workspace, no matter what gita command.
To achieve this, always removing the files manually when changing workspace would be tedious.
from gita.
gita clear
is surely a possibility.
From your description, gita add -a <workspace folder1> <workspace folder2> ...
seems to be the way to go. Then you can set gita context auto
, which will automatically change context for you, based on your current working directory
from gita.
The inner working of auto
context:
When you run gita add -a .
, the automatically-created groups also contain 'group path' (see ~/.config/gita/groups.csv
for examples). When auto
context is on, cwd is compared to group paths to figure out which group is the current context.
For groups not added from gita add -a
, you can manually assign group path using gita group add -p <some path>
. A typical usage case:
/enclosing-folder
/repo1
/repo2
/some-other-folder
/repo3
Say you manually added those 3 repos into a group, then you can also assign the enclosing folder as the group path.
from gita.
gita clear
is surely a possibility.From your description,
gita add -a <workspace folder1> <workspace folder2> ...
seems to be the way to go. Then you can setgita context auto
, which will automatically change context for you, based on your current working directory
i was thinking more in the line of gita add -a <workspace>
and all projects belonging to that workspace are populated automatically with groups created also automatically based on dir structure
from gita.
The inner working of
auto
context:When you run
gita add -a .
, the automatically-created groups also contain 'group path' (see~/.config/gita/groups.csv
for examples). Whenauto
context is on, cwd is compared to group paths to figure out which group is the current context.For groups not added from
gita add -a
, you can manually assign group path usinggita group add -p <some path>
. A typical usage case:/enclosing-folder /repo1 /repo2 /some-other-folder /repo3
Say you manually added those 3 repos into a group, then you can also assign the enclosing folder as the group path.
I know about auto context. however when later one would want to do a push on all repos of the workspace with gita, without changing directory to root workspace, it cannot run gita context none
followed by gita push
. He still has to either change dir to root workspace or either to know or to find the group for the whole workspace.
Later edit:
I have just tried and it seems gita push
without a group or repo does not work actually. But gita pull
does work. I think it would make sense to make it a consistent optional parameter [repo | group, ...]
and also add gita clear
or gita reset
. what do you think?
from gita.
I started working on it here: #214
Later edit:
Marked PR ready for review
from gita.
i was thinking more in the line of gita add -a and all projects belonging to that workspace are populated automatically with groups created also automatically based on dir structure
This is the same as what I suggest. If you run gita add -a /
, then all repos will be added. I was assuming there are several very far-apart folders, each containing some repos with some hierarchy, then one can add -a
on them.
I know about auto context. however when later one would want to do a push on all repos of the workspace with gita, without changing directory to root workspace, it cannot run gita context none followed by gita push. He still has to either change dir to root workspace or either to know or to find the group for the whole workspace
It sounds like a bug. Can you give more details? What is the procedure to trigger the problem?
Suppose you are done working on one workspace (from your description, it seems to be the same as 'context' in gita, i.e., a group). I guess at the point you want to push the changes for that group, then there are two options
- if you know the name of the group, then
gita push <group-name>
- if you have
auto
context on, and you are in the right group path, thengita push
(this requires your PR). The scope of the git operation is the same asgita ll
scope, so you can check with that
In this workflow, it seems gita clear
is not really needed (it's redundant to clear
and add -a
again and again). But it doesn't hurt to have it.
I have just tried and it seems gita push without a group or repo does not work actually. But gita pull does work. I think it would make sense to make it a consistent optional parameter [repo | group, ...] and also add gita clear or gita reset. what do you think?
I deliberately disallowed that for push
, but it makes sense to let user do whatever they want.
from gita.
Related Issues (20)
- respect context for gita freeze
- add a dry-run option for gita clone HOT 2
- Wrong split of repos HOT 6
- Output as json HOT 3
- Customising edit status symbols HOT 2
- I am unable to remove a repository from a group if the repository does not exist anymore HOT 3
- Clone whole user / organisation HOT 2
- Starting again (or better option) HOT 2
- Ability to add repositories to a group based on branch HOT 2
- Context isn't detected HOT 2
- Issues with git pull/fetch HOT 5
- CI does not test recent Python versions
- Color printing does not work with Python 3.11 HOT 1
- dynamic groups based on status HOT 3
- problem displaying repo status properly HOT 12
- Number of modified files
- show status as words as well as colour in `gita ll` HOT 4
- long listing version of `gita ll` that lists modified filenames for each repo HOT 4
- Revised symbols HOT 22
- gita ll - nothing happend HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gita.