Giter Site home page Giter Site logo

Comments (8)

nosarthur avatar nosarthur commented on May 27, 2024

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.

bcdiaconu avatar bcdiaconu commented on May 27, 2024

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 groupcommand. 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.

nosarthur avatar nosarthur commented on May 27, 2024

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.

nosarthur avatar nosarthur commented on May 27, 2024

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.

bcdiaconu avatar bcdiaconu commented on May 27, 2024

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

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.

bcdiaconu avatar bcdiaconu commented on May 27, 2024

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.

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.

bcdiaconu avatar bcdiaconu commented on May 27, 2024

I started working on it here: #214

Later edit:
Marked PR ready for review

from gita.

nosarthur avatar nosarthur commented on May 27, 2024

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

  1. if you know the name of the group, then gita push <group-name>
  2. if you have auto context on, and you are in the right group path, then gita push (this requires your PR). The scope of the git operation is the same as gita 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.