Skip to content

Conversation

legalsylvain
Copy link

Hi all.

first, thanks for this great tool.

I propose an addition to git-aggregator lib: the command show-status.
Basically, gitaggregate will call git status -short for all the listed repositories and display result, if there are some local changes.

Call Sample:

gitaggregate show-status -c repos.yaml

Result Sample:

(INFO) [11:04:04] git_aggregator.repo  pos   Repo /opt/grap_dev/grap-odoo-env-8.0/src/pos: 3 changes found.
    R  pos_margin/__openerp__.py -> pos_margin/__manifest__.py
    R  pos_order_load/__openerp__.py -> pos_order_load/__manifest__.py
    ?? test/

@coveralls
Copy link

coveralls commented Oct 28, 2019

Coverage Status

Coverage decreased (-0.6%) to 80.697% when pulling ffa9960 on legalsylvain:ADD-diff-feature into dfdb3db on acsone:master.

@sbidoul
Copy link
Member

sbidoul commented Oct 30, 2019

Hi @legalsylvain thanks for the contrib.

The function could be useful but sounds quite specific. If we add this, I'd fear it would open the door to an infinite stream of requests for new git commands.

Why not a run-in command or something similar that would run an arbitrary shell command in each repo?

Like git-aggregate -c repos.yml run-in -- git show-status --short ?

@legalsylvain
Copy link
Author

legalsylvain commented Nov 1, 2019

I @sbidoul, thanks for your review. your suggestion seems valid. I don't know exactly how to implement the --, but I developped something similar.

Sample :

gitaggregate run-in --run-in-command 'git status --short'

result :

(INFO) [11:04:04] git_aggregator.repo  pos   Repo /opt/grap_dev/grap-odoo-env-8.0/src/pos :
    R  pos_margin/__openerp__.py -> pos_margin/__manifest__.py
    R  pos_order_load/__openerp__.py -> pos_order_load/__manifest__.py
    ?? test/

@sbidoul sbidoul changed the title [ADD] show-status command [ADD] run-in command Nov 1, 2019
@sbidoul
Copy link
Member

sbidoul commented Nov 1, 2019

@legalsylvain based on #38, you can do this:

    run_in_parser = sub_parsers.add_parser(
        'run-in',
        help="..."
    )
    run_in_parser.add_argument(
        'run_in_command',
        nargs='+',
    )

And then subprocess.call(args.run_in_command)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants