Enabled glab ask git for Amazon Q

What does this MR do and why?

Enabled glab ask git for Amazon Q

References

https://gitlab.com/gitlab-com/ops-sub-department/aws-gitlab-ai-integration/integration-motion-planning/-/issues/610

Screenshots or screen recordings

See glab cli log below

How to set up and validate locally

  1. Setup self-hosted GitLab instance
  2. Configure license with Amazon Q add-on
  3. Configure self-hosted AIGW instance (or one containing this MR)
  4. install GitLab CLI
  5. Connect GitLab CLI to the self-hosted instance
  6. Ask glab cli a question: glab duo ask list last 10 commit titles

CLI Response:

$ glab duo ask list last 10 commit titles                              

Commands:

git log -10 --oneline
git log -10 --pretty=format:"%s"
git log -10 --pretty=format:"%h - %s"

Explanation:

I'll help you with the git commands to list the last 10 commit titles. Here are a few different approaches:

git log -10 --oneline
This command shows the last 10 commits in a condensed format, displaying only the commit hash (shortened) and the commit message in a single line per commit.

git log -10 --pretty=format:"%s"
This command shows only the commit titles (subject lines) of the last 10 commits, without any additional information like hash or author.

git log -10 --pretty=format:"%h - %s"
This command shows the last 10 commits with a short hash followed by the commit title, providing a good balance of identification and readability.

Explanation of the parameters:
- -10: Limits the output to the last 10 commits
- --oneline: Condenses each commit to a single line (shorthand for --pretty=oneline --abbrev-commit)
- --pretty=format:: Allows custom formatting of the output
  - %s: Commit subject (title)
  - %h: Abbreviated commit hash

Choose the format that best suits your needs:
1. First command for a quick overview with hashes
2. Second command for clean titles only
3. Third command for a more detailed but still concise view

? Would you like to run these Git commands? (Y/n) 

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading