Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement status command #72

Merged
merged 8 commits into from
Apr 17, 2020
Merged

Implement status command #72

merged 8 commits into from
Apr 17, 2020

Conversation

lenguyenthanh
Copy link
Contributor

@lenguyenthanh lenguyenthanh commented Apr 16, 2020

Close #30

Usage

dadmin status -o <org> -r <regex> --verbose

Effect

This command will try to show statuses of all local repositories that match a regex pattern.

Output

With --verbose flag

Status for repos in org dadmin-test

+----------------------------------------------------+
| Repo                branch        ±origin  U D M C |
+====================================================+
| test-1              master        2        1 1 1 0 |
| U new-changelog.md                                 |
| D changelog.md                                     |
| M README.md                                        |
| ----                                               |
| private-test-2      master        0        0 0 0 0 |
| test-2              master        0        0 0 0 0 |
| private-test-1      thanh-branch  0        0 0 0 0 |
| =====                                              |
| Total                             1        1       |
+----------------------------------------------------+

Without --verbose flag


Status for repos in org dadmin-test

+------------------------------------------------+
| Repo            branch        ±origin  U D M C |
+================================================+
| test-1          master        2        1 1 1 0 |
| private-test-2  master        0        0 0 0 0 |
| test-2          master        0        0 0 0 0 |
| private-test-1  thanh-branch  0        0 0 0 0 |
| =====                                          |
| Total                         1        1       |
+------------------------------------------------+

@lenguyenthanh lenguyenthanh marked this pull request as draft April 17, 2020 07:23
@snomos
Copy link
Member

snomos commented Apr 17, 2020

The compact / non-verbose view should be more compact. What I had in mind was something like this:

Status for repos in org: dadmin-test
Repo           ±origin U D M
============================
test-1         +2      1 1 1
private-test-2  0      0 0 0
test-2          0      0 0 0
private-test-1  0      0 0 0
============================
Total                  1 1 1
============================

My main use case is to use it as a check to see that merges or oder modifications across many repos have gone well. If the operation succeeded, the number of changes in each repo should be the same, and thus such a tabular overview will immediately highlight repos that need a more thorough check.

All columns must be aligned, the repo name left-aligned, the other columns right-aligned.

@lenguyenthanh
Copy link
Contributor Author

Ok, I understand now, I'll work on that.

Do you have any thought on verbose version?

One thing that you mentioned in #30 is showing diff. But I think showing the diff is quite complicated, and if we want we can make a diff command later.

@snomos
Copy link
Member

snomos commented Apr 17, 2020

Do you have any thought on verbose version?

Probably list filenames for modified files, something like:

test-1         +2      1 1 1
U file1
D file2
M file3

One thing that you mentioned in #30 is showing diff. But I think showing the diff is quite complicated, and if we want we can make a diff command later.

Agree, skip it for now.

@lenguyenthanh
Copy link
Contributor Author

@snomos Just updated the output on the description. Can you please check it?

@snomos
Copy link
Member

snomos commented Apr 17, 2020

Latest version looks good for now, further refinements will have to wait until it has been used a bit more, except one thing: maybe there should be a column for added (A) files?

@lenguyenthanh
Copy link
Contributor Author

lenguyenthanh commented Apr 17, 2020

except one thing: maybe there should be a column for added (A) files?

U means untracked files also means added files.
And other letter meaning:
D: Deleted
M: Modified
C: Conflicted

@lenguyenthanh lenguyenthanh marked this pull request as ready for review April 17, 2020 15:49
@lenguyenthanh lenguyenthanh merged commit 3ce0f7c into master Apr 17, 2020
@lenguyenthanh
Copy link
Contributor Author

lenguyenthanh commented Apr 20, 2020

@snomos, I think I misunderstood you. This command now is definitely need a column for added files.
U only means untracked files.
So I'll update this after I finishing the commit command which I'm working atm

@lenguyenthanh lenguyenthanh deleted the implement-status-command branch April 20, 2020 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List status of all local repos [matching pattern X]
2 participants