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

Implements graph in logging #40

Merged
merged 17 commits into from
Jun 9, 2020
Merged

Conversation

stevenguh
Copy link
Contributor

@stevenguh stevenguh commented Jun 8, 2020

Fixes #38

This PR implements the graph output in logging by executing raw git log commands directly to get the graph output like magit. That allows us to implement many switches that isn't possible with the git api provided by vscode.

Implemented:

  • Show graph in log output with a switch (-g)
  • Show Author name in log
  • Show human readable timestamp on log with date-fn (tree-shaking by webpack should include only that function -- no bloat bundle)
  • Implement all log options. l for current, o for other, h for HEAD, L for all local branches, b for all branches, and a for all references
  • Implement switches for graph(-g), decoration (-d), and simplify by decoration(`-D)
  • Implement rev input box for current (l) option with detached HEAD
  • Implement rev input box for other (o) option with default placeholder
  • Rev input box allows to log multiple rev separated by , or

Inconsistencies/Features still missing in logging:

  • Decoration for log is not as concise as magit. (This requires more input parsing for decoration)
  • rev input box do not have autocomplete like in magit. (This can potentially implemented with a QuickPick)
  • Color graph (Need to use --color, and needs more input parsing, and a way to display color in a text doc)
  • Any switches that requires a follow up input box like -n or -F (This requires more refactoring work with the switch code structure. This refactoring should allow multiple types of follow up input box)
  • Reverse (This will be mutually exclusive with --graph)
  • Reflog
  • Signatures
  • Header
  • Patch
  • Stat

This PR by itself should be ready, I am only listing the missing feature here just to track what else is needed to be done for logging to be feature complete

Copy link
Owner

@kahole kahole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great :) thank you for covering a big part of the logging functionality
Had cursory look, and I had just have a few comments. I will test the functionality more thoroughly later

src/common/gitApiExtensions.ts Outdated Show resolved Hide resolved
src/models/magitLogCommit.ts Outdated Show resolved Hide resolved
src/views/logView.ts Outdated Show resolved Hide resolved
@stevenguh
Copy link
Contributor Author

stevenguh commented Jun 9, 2020

Apparently stdout can read the color if it is forced with --color; however, there are more input parsing work for that as well as we need to figure out a way to use the syntax highlighting system. Anyway, updated the first comment, so we have a history of it somehow.

@kahole kahole merged commit 04e23d4 into kahole:develop Jun 9, 2020
@stevenguh stevenguh deleted the feature/log-graph branch June 9, 2020 18:50
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.

Graph in Logging
2 participants