nosarthur / gita

Manage many git repos with sanity 从容管理多个git库
MIT License
1.67k stars 74 forks source link

dynamic groups based on status #237

Closed mpatnode closed 1 year ago

mpatnode commented 1 year ago

Any consideration on automatically generating dynamic groups based upon status. For example:

  1. I want to create a new branch in every repository which has changes
  2. I want to run a rebase, followed by a force push in all repositories which become out of sync due to the rebase.

Theoretically, you might be able to work around this by extracting repository names from "gita ll" via grep/awk, but that gets a little difficult when changes are displayed by color. :-(

Another thought would be to have options on "gita ll" to only display repositories in a particular state (with or without colors). Then you could parse out a list of repos and pass that to a super command line. IE:

gita super $(gita ll --staged | awk '{print $1}') commit -am 'implement a new feature'

BTW: I assume there's a namespace restriction where a repository name can't be the same a git command?

nosarthur commented 1 year ago

gita ll actually has a -C option to suppress the colors

--staged seems like a good idea too

I never tried with such repo names, but there is probably no explicit checks

nosarthur commented 1 year ago

This is related to #168

nosarthur commented 1 year ago

I am closing this case since picking the staged repos can be achieved using bash tricks

 gita ll -C |rg ' \+ '| cut -d ' ' -f1