<commit_before>GIT-META(1)                     Git Extensions                     GIT-META(1)

NAME
  git-meta -- execute the same git command in multiple repositories


SYNOPSIS
  git meta <some_git_command_with_relevant_arguments>

DESCRIPTION
  Convenient way to execute the same git command in a set of related repos,
  currently the list of an organization's repositories on Github.

  Said list is determined via a Github API v3 call, and cached locally for
  performance.

OPTIONS

  git meta --version      # print out this script's version number
  git meta --help         # you're looking at it
  git meta --check        # checks all the required settings and configurations
  git meta --refresh      # refresh the list of organization repos
  git meta --count        # print out the count of organization repos (per type)
  git meta --list         # print out the names of all organization repos
  git meta --paths        # print out the full path for each organization repos
  git meta --missing      # print out names of repos that haven't been cloned
  git meta --stale        # list repos that have been deleted on github.com
  git meta --excess       # list repos that don't exist on github.com
  git meta --spurious     # list cloned repos whose remote doesn't match a github.com origin
  git meta --clone        # clones missing repositories into "${HOME}/Workarea" (by default)
  git meta --query (args) # query Github repo metadata for each repository
  git meta --eval <ruby>  # execute the given Ruby code in the context of each repo
  git meta --find <ruby>  # print out the repos for which the Ruby code evaluates to true
  get meta --raw <cmd>    # execute <cmd> inside each git repository

EXAMPLES

  # count the number of organization repos
  git meta --list | wc -l

  # disk usage of each locally cloned organization repo
  git meta --paths | xargs -n 1 du -hs

  # ... or by using the `--raw` option
  git meta --raw 'du -hs .'

  # group and count the repos by Github-determined language
  git meta --query language | cut -f 2 -d : | sort | uniq -c | sort -n -r

  # find out the most-used Ruby versions
  git meta --raw '[ -f .ruby-version ] && cat .ruby-version' | cut -f 2 -d : | sort | uniq -c | sort -n -r

  # find Github repos without a description
  git meta --query description | egrep ': *$'

  # print out the number of days since the last push to each repository
  git meta --eval 'puts "%%d days" %% ((Time.now - pushed_at) / 60 / 60 / 24)'

  # find all projects that have been pushed to in the last week
  git meta --find '((Time.now - pushed_at) / 60 / 60 / 24) <= 7'

  # fetch remote branches for all organization repos
  git meta fetch -p

  # print out the local branch for each repo
  git meta rev-parse --abbrev-ref=strict HEAD

  # find all repos for which the 'origin' remote isn't github.com
  git meta config --get remote.origin.url | fgrep -v git@github.com:

  # for each repo, list all remote branches, sorted by the "age" of the last commit on each branch
  git meta for-each-ref --sort="-authordate" --format="%%(refname)%%09%%(authordate:relative)%%09%%(authorname)" refs/remotes/origin

  # same as above, but columnize the generated output (NOTE: replace '^I' with CTRL-V/CTRL-I in your terminal)
  git meta for-each-ref --sort="-authordate" --format="%%(refname)%%09%%(authordate:relative)%%09%%(authorname)" refs/remotes/origin | column -t -s "^I"

  # same as above, but refresh the list of remote branches first
  git meta fetch -p ; git meta for-each-ref --sort="-authordate" --format="%%(refname)%%09%%(authordate:relative)%%09%%(authorname)" refs/remotes/origin

  # find all Rails projects
  git meta --raw '[ -f Gemfile ] && fgrep -q -l rails Gemfile && echo uses Rails' | cat

QUERY ARGUMENTS

  The following is a list of valid arguments for the 'git meta --query' option

    %{query_args}
<commit_msg>Another example: repo creation per quarter<commit_after>GIT-META(1)                     Git Extensions                     GIT-META(1)

NAME
  git-meta -- execute the same git command in multiple repositories


SYNOPSIS
  git meta <some_git_command_with_relevant_arguments>

DESCRIPTION
  Convenient way to execute the same git command in a set of related repos,
  currently the list of an organization's repositories on Github.

  Said list is determined via a Github API v3 call, and cached locally for
  performance.

OPTIONS

  git meta --version      # print out this script's version number
  git meta --help         # you're looking at it
  git meta --check        # checks all the required settings and configurations
  git meta --refresh      # refresh the list of organization repos
  git meta --count        # print out the count of organization repos (per type)
  git meta --list         # print out the names of all organization repos
  git meta --paths        # print out the full path for each organization repos
  git meta --missing      # print out names of repos that haven't been cloned
  git meta --stale        # list repos that have been deleted on github.com
  git meta --excess       # list repos that don't exist on github.com
  git meta --spurious     # list cloned repos whose remote doesn't match a github.com origin
  git meta --clone        # clones missing repositories into "${HOME}/Workarea" (by default)
  git meta --query (args) # query Github repo metadata for each repository
  git meta --eval <ruby>  # execute the given Ruby code in the context of each repo
  git meta --find <ruby>  # print out the repos for which the Ruby code evaluates to true
  get meta --raw <cmd>    # execute <cmd> inside each git repository

EXAMPLES

  # count the number of organization repos
  git meta --list | wc -l

  # disk usage of each locally cloned organization repo
  git meta --paths | xargs -n 1 du -hs

  # ... or by using the `--raw` option
  git meta --raw 'du -hs .'

  # group and count the repos by Github-determined language
  git meta --query language | cut -f 2 -d : | sort | uniq -c | sort -n -r

  # find out the most-used Ruby versions
  git meta --raw '[ -f .ruby-version ] && cat .ruby-version' | cut -f 2 -d : | sort | uniq -c | sort -n -r

  # find Github repos without a description
  git meta --query description | egrep ': *$'

  # print out the number of days since the last push to each repository
  git meta --eval 'puts "%%d days" %% ((Time.now - pushed_at) / 60 / 60 / 24)'

  # find all projects that have been pushed to in the last week
  git meta --find '((Time.now - pushed_at) / 60 / 60 / 24) <= 7'

  # fetch remote branches for all organization repos
  git meta fetch -p

  # print out the local branch for each repo
  git meta rev-parse --abbrev-ref=strict HEAD

  # find all repos for which the 'origin' remote isn't github.com
  git meta config --get remote.origin.url | fgrep -v git@github.com:

  # a kind of "repository creation" report: count the number of repos created in each quarter
  git meta --eval "class ::Time; def quarter() (month.to_f / 3.0).ceil; end; end; puts format('%%d-Q%%d', created_at.year, created_at.quarter)" | sort | uniq -c

  # for each repo, list all remote branches, sorted by the "age" of the last commit on each branch
  git meta for-each-ref --sort="-authordate" --format="%%(refname)%%09%%(authordate:relative)%%09%%(authorname)" refs/remotes/origin

  # same as above, but columnize the generated output (NOTE: replace '^I' with CTRL-V/CTRL-I in your terminal)
  git meta for-each-ref --sort="-authordate" --format="%%(refname)%%09%%(authordate:relative)%%09%%(authorname)" refs/remotes/origin | column -t -s "^I"

  # same as above, but refresh the list of remote branches first
  git meta fetch -p ; git meta for-each-ref --sort="-authordate" --format="%%(refname)%%09%%(authordate:relative)%%09%%(authorname)" refs/remotes/origin

  # find all Rails projects
  git meta --raw '[ -f Gemfile ] && fgrep -q -l rails Gemfile && echo uses Rails' | cat

QUERY ARGUMENTS

  The following is a list of valid arguments for the 'git meta --query' option

    %{query_args}

{'fraction_non_alphanumeric': 0.09683032939714108, 'fraction_numerical': 0.00795525170913611, 'mean_word_length': 2.9134241245136185, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7509679', 'n_tokens_mistral': 2487, 'n_tokens_neox': 2293, 'n_words': 1086}