write a bash oneliner to get all gitlab commits of a given user, show their message,…
- User
write a bash oneliner to get all gitlab commits of a given user, show their message, location (repo of the commit), and date
Assistant
Here is a bash one-liner to get all GitLab commits of a given user, show their message, location (repo of the commit), and date:
curl -s "https://gitlab.com/api/v4/users/{username}/projects" | jq -r '.[].web_url' | xargs -I{} sh -c 'git -C {} log --author="{username}" --pretty=format:"%h %ad %s%d [%cn]" --date=iso'Breakdown:
curl -s ...fetches all the projects (repos) belonging to the{username}via GitLab APIjq -r '.[].web_url'extracts just the web URL for each projectxargs -I{}runs the git log command on each project URLgit -C {} log ...runs git log in each project, showing commit hash, date, message, and location in brackets for commits authored by the
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.