Compare commits

...

204 Commits

Author SHA1 Message Date
arzzen
376887a394 update manpage 2025-06-17 19:01:38 +02:00
arzzen
cebb5a8f48 Merge pull request #188 from git-quick-stats/task/issue-116
_MENU_THEME=none
2025-06-17 18:52:01 +02:00
arzzen
343351b762 update manpage 2025-06-17 18:49:38 +02:00
arzzen
95136d3f92 add filter ignored authors 2025-06-16 14:40:49 +02:00
arzzen
79c735c814 fix backslash 2025-06-16 14:36:11 +02:00
arzzen
ec6a95d2ef cleanup 2025-06-16 14:33:03 +02:00
arzzen
b65b100cd8 fix tests 2025-06-16 14:29:24 +02:00
arzzen
dd7719c3b0 sorting contribution stats 2025-06-16 14:03:21 +02:00
arzzen
c34ceb4c0e _MENU_THEME=none 2025-06-16 08:55:00 +02:00
arzzen
850b7453eb Merge pull request #187 from FloezeTv/fix/default-until-date-locale 2025-06-15 15:32:51 +02:00
FloezeTv
5063d1aad7 Fix default until-date in other locales
The default until-date used `date` with the system's default locale
as `date` produces localized output by default.
However, `date -d` cannot parse this localized output
but requires a locale independent format:
https://www.gnu.org/software/coreutils/manual/html_node/Options-for-date.html#index-_002dd-19
This sets the locale to a format parsable by `date` as in the article.
2025-06-15 14:03:10 +02:00
arzzen
53b9971cf7 fix tests 2025-06-15 13:30:16 +02:00
arzzen
eec6d53ce9 Merge pull request #183 from git-quick-stats/feat/activity-calendar
Activity calendar by author
2025-06-14 19:04:01 +02:00
arzzen
d06a7ca090 Merge branch 'master' into feat/activity-calendar 2025-06-14 19:03:52 +02:00
arzzen
462439a855 Merge pull request #184 from git-quick-stats/task/ignore-authors
Ignore authors #141
2025-06-14 19:02:48 +02:00
arzzen
c467a9694b merge 2025-06-14 14:48:39 +02:00
arzzen
d4f71cfdad removed unuse arrays 2025-06-14 14:43:14 +02:00
arzzen
88e369503e link correction 2025-06-14 14:38:28 +02:00
arzzen
afd61ce9c2 Ignore authors #141 2025-06-14 14:30:56 +02:00
arzzen
e1e02024a1 Activity calendar by author 2025-06-08 19:39:29 +02:00
arzzen
d1641f7bf3 Merge pull request #181 from jwilk-forks/anchor-regexps
Anchor regexps in commitsPerAuthor()
2025-06-08 19:33:43 +02:00
arzzen
8de8c43212 Merge pull request #182 from jwilk-forks/json-spelling 2025-02-27 17:49:37 +01:00
Jakub Wilk
f4ec72073d Fix typo in JSON output 2025-02-24 08:40:54 +01:00
Jakub Wilk
b0003bef49 Anchor regexps in commitsPerAuthor()
Fixes:

    $ git clone -q https://github.com/util-linux/util-linux.git
    $ git -C util-linux quick-stats -a | grep -w uthor
            23    uthor                                    Karel Zak              0.1%
            3     uthor                                    Ondrej Oprala          0.0%
            2     uthor                                    Samuel Thibault        0.0%
            ...
2025-02-24 08:32:23 +01:00
arzzen
a833a5f431 Update .mailmap 2025-01-14 13:49:39 +01:00
arzzen
886f64f086 Merge pull request #180 from reitzig/patch-1
fix(docker): tell Git that the workdir is safe
2025-01-05 17:43:46 +01:00
Raphael
115b21a48d fix(docker): tell Git that the workdir is safe
When bind-mounting a Git repository to the workdir, Git would complain about 'dubious ownership'.

We add an exception to the global Git config, in the way Git tells us to.
This should be safe since
- we run in a container, and
- the user can set the mount to read-only.

refs: issue #179
2025-01-03 14:00:30 +01:00
arzzen
4d515b88b3 Update LICENSE 2024-10-27 14:07:49 +01:00
arzzen
9b3c0e5db1 Merge pull request #176 from tomice/bugfix/161-changelogs-wrong-output
Address inconsistency in changelogs
2024-10-25 20:26:54 +02:00
arzzen
86ad0af8bb Update FUNDING.yml 2024-10-25 20:18:35 +02:00
Tom Ice
fb488abe3e Address inconsistency in changelogs
* Original function lacked explicit sorting by time.
  Adding sorting by time within the same day to help make
  changelogs consistent.
2024-10-12 17:16:21 -04:00
arzzen
3cce04ddad Merge pull request #174 from tomice/master 2024-10-06 16:04:25 +02:00
Tom Ice
d4e56cf557 Adjust commitsByYear() to support multiple dates
* commitsByYear() previously could only support Default-style
  dates for git log. However, a user can use a variety of different
  date formats such as relative, default, iso, rfc, short, and raw.

  This change modifies commitsByYear() to handle multiple different
  date strings

Fixes #172
2024-10-01 20:43:39 -04:00
Tom Ice
cf239e5523 Update README.md
* Update README.md's screenshots to show new features added since last screenshots were taken
2024-09-19 20:45:36 -04:00
Tom Ice
a0f495894b Merge pull request #173 from laxdog/master
Fix stats for situation where there are no inserts / deletes
2024-09-19 16:20:32 -04:00
Tom Ice
4faf233ad1 Merge pull request #170 from funnelfiasco/issue169-add_new_contributors
Add a list of new contributors
2024-09-19 16:20:00 -04:00
Ben Cotton
7d5087795e Address more feedback
* Add date examples to prompts
* Update tests

Signed-off-by: Ben Cotton <bcotton@funnelfiasco.com>
2024-09-19 14:28:41 -04:00
Ben Cotton
fe2df31c36 Address review feedback
* Indicate how we're sorting new contributors
* Don't fork for `date` checks
* Include reference in the manpage

Signed-off-by: Ben Cotton <bcotton@funnelfiasco.com>
2024-09-19 11:57:38 -04:00
Michael Robinson
615563459f Fix stats for situation where there are no inserts / deletes 2024-09-17 15:39:48 +01:00
Ben Cotton
8c1d81a29d Add a list of new contributors
This reports generates a list of all contributors whose first commit was
after a specified date.

Fixes #169

Signed-off-by: Ben Cotton <bcotton@funnelfiasco.com>
2024-06-26 09:59:46 -04:00
Tom Ice
9f96cecf42 Merge pull request #167 from tomice/master
Update documentation for clarity
2024-05-17 22:05:55 -04:00
Tom Ice
5b01b5e055 Update documentation for clarity
* Added additional information to better explain how to use this
  on macOS.

* Updated some of the deps used

* Minor adjustments in the README.md

Addresses Issue #166
2024-05-16 15:23:16 -04:00
arzzen
32a84903ff Merge pull request #165 from chenrui333/patch-1
improve macos error message wrt gnu date
2024-04-29 15:46:11 +02:00
Rui Chen
cd6d67df06 improve macos error message wrt gnu date 2024-04-28 11:17:22 -04:00
Tom Ice
00d13c0b79 Merge pull request #164 from tomice/master
Handle error where BSD date is being used
Create new repo if running tests in non-git area
2024-04-27 13:43:51 -04:00
Tom Ice
b525ed3b5c Create new repo if running tests in non-git area
* When running "make test" in the root directory of this codebase,
  an error will occur as this shell script requires a repo to be
  initialized before it can properly execute.

  This was done in the past, but at some point, it was removed.
  This adds the feature back, tests if we are in a git directory
  by using a built-in git command, and only performs this action
  if a git repo doesn't already exist. All actions are sent to
  /dev/null so the testing should look opaque to the end user.

  Note that tests will still fail if a user is missing a required
  utility to perform the functionality of git-quick-stats.

* Fixed a typo in the man page

Fixes #162
2024-04-20 17:31:12 -04:00
Tom Ice
41a8542aaa Handle error where BSD date is being used
* Users on macOS and other older distributions of Linux and Unix
  cannot fully utilize this application as a handful of date/time
  strings in here are specific to the GNU utility found on most
  modern version of Linux.

  Until every date/time case is handled between the BSD version of
  date and the GNU version of date, let's error out akin to how we
  do it if the user doesn't have every utility installed to run
  this script.

  Users can get around this by using package managers on macOS such
  as homebrew, macports, etc and making sure that 'date' points to
  the GNU version of date instead of the BSD version. Linux and
  Unix users can get around this by installing the GNU version of
  date, as well.

* Removed checking OSTYPE in the format_date() function as checking
  if someone is on a machine that identifies as Darwin is not enough
  to handle other edge cases where an older version of BSD date
  might be present on the system.
2024-04-20 14:15:07 -04:00
arzzen
7b1e0b2a65 Merge pull request #157 from Dica-Developer/41
calculate the day before the given since date
2024-01-10 08:13:40 +01:00
Martin Schaaf
43bc82520e calculate the day before the given since date as it excludes the given daten the inclusion is wanted 2024-01-09 16:40:28 +01:00
arzzen
d33ede9bcc Merge pull request #142 from cam-rod/timezone-format
Update formatting and sort commits by timezone
2023-12-22 16:18:52 +01:00
arzzen
7f24d202b9 Merge pull request #155 from fox-forks/hyperupcall-document-defualt-git-limit
docs: Document default `_GIT_LIMIT` value
2023-12-22 16:17:22 +01:00
Edwin Kofler
62b128a3ce docs: Document default _GIT_LIMIT value 2023-11-18 17:44:29 -08:00
arzzen
8515fe3a94 cleanup 2023-10-24 18:13:00 +02:00
arzzen
37bfde67ed Merge pull request #153 from arzzen/arzzen-patch-1 2023-10-24 15:33:53 +02:00
arzzen
d886facadf fix format date 2023-10-24 14:52:00 +02:00
arzzen
aa6619508a Update git-quick-stats
fix #152
2023-10-24 09:34:29 +02:00
arzzen
a813846c9f Merge pull request #151 from YDX-2147483647/patch-1
fix: Ubuntu does not support `date -j`
2023-10-17 06:26:33 +02:00
Y.D.X
22bf354da4 fix: Ubuntu does not support date -j
This is required for changelogs.

Resolves #147
2023-10-09 17:29:08 +08:00
arzzen
0fea0323a4 Merge pull request #150 from riderius/master 2023-10-04 20:50:24 +02:00
riderius
4fcf8f5fef test: fix a typo in the 1st test
Signed-off-by: riderius <riderius.help@gmail.com>
2023-10-04 18:27:38 +03:00
arzzen
374aa2ef72 Merge pull request #145 from s-okita/master
Add stats by author per weekday functionality
2023-06-23 15:01:04 +02:00
s-okita
33dca7f3ed Update git-quick-stats.1 2023-06-23 17:07:18 +09:00
s-okita
2ecb296442 Merge branch 'arzzen:master' into master 2023-06-07 02:42:22 +09:00
arzzen
428d25d0ef Merge pull request #144 from jgtoriginal/master
add day name to date
2023-06-06 14:58:29 +02:00
s-okita
c3110e985e Add stats by author per weekday functionality
* Added the ability to see git stats both per weekday, as well as
  by author per weekday. It should respect all global options.

* Updated tests, README.md, and man page to reflect the new changes
2023-06-06 19:36:47 +09:00
jgtoriginal
ebbeb34837 add day name to date
when grouping by author -L, I found it hard to read YYYY-MM-DD, so added day name to that.
2023-05-25 01:14:05 +01:00
Cameron Rodriguez
6cdca7c7c7 Sort, use more stable formatting for commits by timezone
Switch to `git log` for formatting commits sorted by timezone, to avoid
odd formatting cases. Also sorts timezones from negative to positive.
2023-04-04 22:30:35 -04:00
Tom Ice
71d414eb4a Merge pull request #137 from pyxide/fix/json-format-output
fix: json format output with multiline content
2022-07-11 16:09:01 -04:00
pyxide
d8346210a4 fix: json format output with multiline content 2022-07-11 19:15:07 +02:00
Tom Ice
b85760e8b9 Merge pull request #136 from dotmpe/master
Misc. fixes on filtering, added commits-by-year
2022-02-26 21:01:26 -05:00
B. van Berkum
07ad3b57a7 Updated screenshot URLs after PR#136 changes 2022-02-24 04:54:27 +01:00
B. van Berkum
dec1c4e103 Add --commits-by-year; put 'since' at first commit
- Added commits-by-year graph/statistics.
- Made 'since' use first reachable commit, instead of GIT epoch (May
  2005). To avoid empty bars in the new 'Commits by years' graph.

- Removed start-/end-year filter: on -by-weekday, -hour and -month. Instead
  made each `grep` look for its date tag fixed in a more specific sequence
  so as to not match commit message.

  Was giving problems if a since/until date-span larger than one year was given
  (ie. #135, #130, #123).

  Maybe should look at removing commit message from log listing entirely.
  Not sure why `grep -E "($startYear|$endYear)"` was ever introduced yet.

- Made tests run properly, updated test with usage output.
  Added a test-case with LC_TIME=POSIX.
2022-02-19 00:01:07 +01:00
Lukáš Mešťan
2a0294941f Update README.md 2021-08-19 09:16:37 +02:00
Lukáš Mešťan
22f1b3563d Merge pull request #133 from tomice/master
Add stat by author per timezone functionality
2021-06-15 13:52:05 +02:00
Tom Ice
628b31ffd8 Convert README.md inline HTML to pure Markdown
* The README.md contained inline HTML for the contributors, backers,
  and sponsors section. This technically works when the README.md is
  rendered within a webpage, but other Markdown readers, such as those
  that are built into GUIs, may or may not render them correctly.
  This changes those inline HTML hyperlinks to pure Markdown as
  specified by Markdown Lint rule MD033. For more info, see:

  https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md#md033

* Fixes some other small whitespace and inconsistency issues
2021-06-12 11:47:56 -04:00
Tom Ice
1e5723d7a2 Add stats by author per timezone functionality
* Added the ability to see git stats both per timezone, as well as
  by author per timezone. It should respect all global options.

* Adjusted the non-interactive menu as it was missed during the
  reorganization effort

* Updated tests, README.md, man page, and screenshots to reflect the
  new changes

* Resolves #128
2021-06-11 17:35:56 -04:00
Tom Ice
0c1749a560 Reorganize code to be consistent with the menu
* Before, we had various functions in a different order from the
  interactive menu in the code base. This changes our ordering of
  the functions and aligns the interactive menu, man pages, README.md,
  and code base so that they are all following the same paradigm.

  Also fixes some minor missing keywords
2021-06-11 16:11:26 -04:00
Tom Ice
ecab54c630 Fix some whitespace and other internal formatting
* Did some minor clean up of white space to try to adhere to the
  classic 80 characters per line standard that is typically found
  in shell code. It isn't perfect, but it's getting us closer.

* Added some extra notes and todos for adjustments that can be made
  and potential future work for others to jump in on.
2021-06-11 13:26:34 -04:00
Lukáš Mešťan
7219205696 Merge pull request #131 from treussart/export-csv
Export CSV of detailedGitStats
2021-05-20 07:46:54 +02:00
Tom Ice
dd3c97816e Update README.md to display new functionality
* With pull request #131, we add new functionality for both interactive and non-interactive modes.
  This change updates the README.md to reflect our new menu option for outputting the stats in CSV
2021-05-20 00:17:23 -04:00
Matthieu Treussart
d2b273eead Export CSV of detailedGitStats 2021-05-20 05:25:09 +02:00
Lukáš Mešťan
5b08bb0b52 Merge pull request #129 from treussart/add_git_branch_option
Add git branch option
2021-05-19 08:36:00 +02:00
Matthieu Treussart
08d1a5a6e3 Set git branch in options 2021-05-18 21:51:40 +02:00
Lukáš Mešťan
f5c2b82f02 Merge pull request #127 from pawaer/fix/issue126
Replaced grep commit by grep with regex including git sha hash
2021-04-29 08:36:34 +02:00
Pawaer
bf29c19cf5 Replaced grep commit by grep with regex including git sha hash
myDailyStats() used grep commit to detect count of commits. This
also increases the count by mentioning commit in the commit
message.

Therefore a grep with regex is used that expects a 40 digit/char
SHA1 hash after the word commit.
2021-04-24 21:50:30 +02:00
Lukáš Mešťan
c6cb74a5e0 Merge pull request #125 from arzzen/fix/issue-123
fix shortlog filter
2021-04-02 19:16:02 +02:00
arzzen
3f0befcd07 fix shortlog filter 2021-04-02 13:34:46 +02:00
Lukáš Mešťan
292876846d Merge pull request #124 from tomice/master
Fix escape sequences when outputting to non-TTYs
2021-03-31 17:31:28 +02:00
Tom Ice
e70c288225 Fix escape sequences when outputting to non-TTYs
* When performing actions such as redirecting the stats to a file,
  the terminal escape sequences for handling colors gets added
  to the top message in the text file. While running commands such
  as sed can fix this, it is inconvenient for users wishing to redirect
  or pipe the stats in a clean way.

  Attempting to use test -t yielded some unexpected results, as well
  as extra logic for handling a non-tty case, so for now, we are
  simply removing the colors from the message so it defaults to
  standard terminal colors and formatting

Fixes #122
2021-03-31 10:33:25 -04:00
Lukáš Mešťan
4d2621b084 Update LICENSE
bump year
2021-02-24 08:14:12 +01:00
Lukáš Mešťan
2318d42765 Merge pull request #121 from tomice/master
Change default date to be when git was first invented
2021-02-05 17:02:54 +01:00
Tom Ice
ef74d79102 Change default date to be when git was first invented
* The current default date is set to UNIX Epoch time. However, it seems
  some people are possibly having issues with date/time formats within
  their OSes. This commit attempts to fix issue #115 when the default
  date may be too old and cause no output to show
2021-01-29 19:31:29 -05:00
Lukáš Mešťan
82f8690285 Merge pull request #120 from vutny/fix-tests-assert-contains
test: fix assert_contains and its invocation
2020-12-19 19:55:30 +01:00
Denys Havrysh
0f641ea0e6 test: fix assert_contains and its invocation 2020-12-18 17:27:46 +02:00
Lukáš Mešťan
6c7bd4fddf Merge pull request #118 from vutny/fix-decimal-percent-view
fix: correct localized decimal percent numbers
2020-12-18 08:22:55 +01:00
Denys Havrysh
9f9617b88b fix: correct localized decimal percent numbers 2020-12-16 17:28:13 +02:00
Lukáš Mešťan
8cea653d6c Update FUNDING.yml 2020-09-09 12:52:08 +02:00
Lukáš Mešťan
efa004122e Update README.md 2020-08-25 18:07:35 +02:00
Lukáš Mešťan
0534327006 Merge pull request #114 from SuperSandro2000/patch-1
Mention apt install method
2020-08-14 10:19:35 +02:00
Sandro
a113dc306f Mention which releases have the package 2020-08-14 10:01:56 +02:00
Sandro
0fc2fe956b Mention apt install method 2020-08-12 22:51:14 +02:00
Lukáš Mešťan
1efe3133dc Merge pull request #113 from mcpcpc/master
usage: remove non-POSIX compliant features
2020-07-26 15:19:37 +02:00
Michael Czigler
3fd0ee2453 usage: remove non-POSIX compliant features 2020-07-23 09:33:37 -04:00
Lukáš Mešťan
a4f19c9e54 Merge pull request #112 from mcpcpc/usage
usage: remove non-POSIX compliant features
2020-07-23 13:48:48 +02:00
Michael Czigler
cd38c40fe8 usage: remove non-POSIX compliant features 2020-07-22 11:46:58 -04:00
Lukáš Mešťan
3283122a38 Merge pull request #109 from mcpcpc/master
checkUtils: remove non-POSIX compliant features
2020-07-22 17:18:59 +02:00
Michael Czigler
920b95c042 squash commit, remove non-POSIX features in checkUtils 2020-07-21 09:07:44 -04:00
Lukáš Mešťan
810ffcff54 update homebrew badge url 2020-07-14 19:05:50 +02:00
Lukáš Mešťan
f9df7ee5e2 Merge pull request #106 from arzzen/task/log-options
Ability to use options for git log command
2020-07-10 18:18:58 +02:00
arzzen
e31fc931c8 add git log options to myDailyStats 2020-07-10 18:13:01 +02:00
arzzen
0655814800 fix test 2020-07-10 08:02:28 +02:00
arzzen
1eb8c53f09 ability to use options for git log command 2020-07-09 09:21:25 +02:00
Lukáš Mešťan
3b2f26e85d Merge pull request #103 from tomice/master
Fix folder excluding pathspec bug #102
2020-06-28 12:59:29 +02:00
Tom Ice
93aa829eae Fix folder excluding pathspec bug #102
* There was an issue with quoting in the pathspec variable where
  the variable would get mangled when being passed to different
  parameters during git operations. This change fixes that.

Fixes #102
2020-06-27 20:02:50 -04:00
Lukáš Mešťan
1a11540b67 Merge pull request #101 from tomice/master
Fix divide by zero error during lines changed calc
2020-05-11 16:15:30 +02:00
Tom Ice
6692ec8aa3 Hotfix for non-GNU awk on macOS 2020-05-10 15:10:30 -04:00
Tom Ice
63eba9f1b8 Fix divide by zero error during lines changed calc
* A new feature was implemented to show percentages when displaying
  detailed stats (menu options 1 and 2, or options -T and -R).
  However, the calculation during "lines changed" may cause an error
  within awk stating it cannot divide by zero as there is no check
  to see if the divisor is larger than zero.

  This commit attempts to fix that issue, albeit admittedly not in
  the most elegant way...

Fixes #100
2020-05-10 14:57:09 -04:00
Lukáš Mešťan
228e67f879 Merge pull request #99 from tomice/master
Fix issue with env vars not respecting spaces
2020-05-07 10:29:58 +02:00
Tom Ice
891e2277ad Add info on how to use experimental JSON feature
* The JSON output feature was not originally explained well and needed
  some additional information on how it worked. Extra info on how to use
  this feature, as well as reminding people that this is a beta feature,
  was added to help the users when trying out this option

Fixes #96
2020-05-01 17:57:19 -04:00
Tom Ice
cc87b3046f Fix issue with env vars not respecting spaces
* If a space existed within _GIT_SINCE, _GIT_UNTIL, or _GIT_PATHSPEC,
  the shell would split the variable at the first space it saw because
  the variables were not quoted.

  If you were to simply quote the variables, then a null variable would
  get inserted into git's log, and it would cause an error.

  This change adds default values to these variables at all times so
  the variables are always assigned to something that git understands.

Fixes #95
2020-05-01 15:29:33 -04:00
Lukáš Mešťan
7aea224e21 Merge pull request #98 from novadiscovery/97-new-lines-as-percent
add percentage for new lines as well
2020-05-01 11:37:49 +02:00
frederic.cogny
c37492bb4c chore(git-quick-stats): add tab instead of space for nicer alignment between percentage counts 2020-05-01 01:03:21 +02:00
frederic.cogny
c258e34afe feat(git-quick-stats): add percentage for new lines as well 2020-05-01 00:36:10 +02:00
Lukáš Mešťan
9e18cf35d4 Merge pull request #94 from arzzen/patch-issue-91
Update commitsByWeekday sorting
2020-02-18 11:31:35 +01:00
Lukáš Mešťan
24ae67ae57 update commitsByWeekday sorting
Fix inconsistent sum sorting in by-weekday, #91
2020-02-14 09:34:46 +01:00
Lukáš Mešťan
ed0e3cbb6b Merge pull request #93 from tomice/master
Fixing OS X compatibility with merge feature
2020-02-13 09:42:06 +01:00
Tom Ice
46a771138e Fixing OS X compatibility with merge feature
* OS X utilizes an older version of GNU Bash. As such, certain features
  such as lowercase expansion can fail. This commit removes the Bash 4.0
  syntax in favor of a POSIX syntax with awk.
2020-02-11 08:25:44 -05:00
Lukáš Mešťan
9f54b87ed5 Update FUNDING.yml 2020-02-05 09:33:07 +00:00
Lukáš Mešťan
246076f5f6 Bump year 2020-01-20 08:00:06 +00:00
Lukáš Mešťan
c0a1795c1a Merge pull request #89 from arzzen/feature/issue-88
refs #88
2020-01-20 08:57:48 +01:00
Lukáš Mešťan
63b9b42034 Merge pull request #90 from tomice/feature/issue-88
Add view strategy to allow merge commits in stats
2020-01-20 08:53:12 +01:00
Tom Ice
90f9e359c3 Add view strategy to allow merge commits in stats
* Users can now switch between allowing merge commits in their stats,
  showing only merges in the stats, or ignoring merge commits in
  the stats all together.

  Showing merges might be good for people who wish to see the entire
  history as git shows it by default. For this, setting the new variable
  _GIT_MERGE_VIEW to enable will show merge commits in the stats together
  with normal commits.

  Showing only merges might be useful for people who wish to see how
  much of their git history is taken up by merges alone. It can be useful
  for re-evaluating a particular workflow. For this, setting the new var
  _GIT_MERGE_VIEW to exclusive will show only merge commits in the stats.

  The default action is to not display merge commits.

Resolves #88
2020-01-17 10:53:51 -05:00
Lukas Mestan
82ba58e01d refs #88 2020-01-11 14:09:04 +01:00
Lukas Mestan
5b64a8de17 fix path 2019-12-16 14:05:28 +01:00
Lukas Mestan
b77021c545 update .github dir 2019-12-16 14:04:23 +01:00
Lukáš Mešťan
62458b6fd1 Merge pull request #87 from arzzen/arzzen-patch-1
Update issue templates
2019-12-16 14:01:55 +01:00
Lukáš Mešťan
ad5b503eea Update issue templates 2019-12-16 14:01:31 +01:00
Lukas Mestan
96b5dab53f remove docs 2019-12-16 13:58:01 +01:00
Lukáš Mešťan
85b7fb1cdf Create CNAME 2019-12-16 13:11:25 +01:00
Lukáš Mešťan
151b260be1 Update README.md 2019-12-16 11:04:15 +01:00
Lukáš Mešťan
f06b7f4833 Update README.md 2019-12-16 11:01:04 +01:00
Lukáš Mešťan
bf7533afa7 Merge pull request #86 from frxyt/develop
Add Dockerfile
2019-12-16 10:52:26 +01:00
Jérémy WALTHER
27edcf0f7a Add Dockerfile 2019-12-12 19:09:56 +01:00
Lukáš Mešťan
dc72babb20 Merge pull request #82 from 4ndrej/patch-1
refactor checkUtils: remove repeating commands
2019-10-27 10:12:00 +01:00
Andrej
c8ad2fba84 array of util names are read only now 2019-10-25 14:23:15 +02:00
Andrej
5cf8feee53 refactor checkUtils: remove repeating commands
putting checked utils into array and running through the array in for loop cleans the code
2019-10-25 10:41:05 +02:00
Lukáš Mešťan
17fc8f326c Merge pull request #81 from lightopenid/gh-68
update travis yml
2019-10-13 17:49:01 +02:00
Lukas Mestan
d5c17e43c0 update travis yml 2019-10-13 17:44:51 +02:00
Lukáš Mešťan
75c8bdc0de Merge pull request #80 from ProcrastinatorCp/gh-70
Support commits by co-authors
2019-10-13 17:41:05 +02:00
Lukáš Mešťan
1a9be34f4c Update .travis.yml 2019-10-13 17:30:01 +02:00
Chandra Prakash
4979eaa69f Support commits by co-authors
https://github.com/arzzen/git-quick-stats/issues/70

Commits by multiple authors (co-authored-by) were only counted towards main author.
Modified commitsPerAuthor() to include co-author's commits.
2019-10-13 02:16:54 +08:00
Lukáš Mešťan
1ed838f532 Merge pull request #79 from tomice/master
Updating README.md
2019-10-10 14:26:04 +02:00
Tom Ice
0fd9171e11 Adding info on how to exclude files in the docs
* Added information in the README.md to show how to exclude files
  from the stats by utilizing git pathspec
* Updated the built-in help, manpage, and tests to reflect how git
  pathspec can be utilized on files and folders
* Removed the \r tokens that were put in README.md from Windows

Fixes #61
2019-10-10 08:15:42 -04:00
Lukáš Mešťan
b14f364b6a Update FUNDING.yml 2019-10-10 08:08:18 +00:00
Tom Ice
10ad00bcbb Updating README.md
* Added info that demonstrates this utility has the ability to
  choose between running this as "git-quick-stats" or
  "git quick-stats" as requested in Issue #77
* Adjusted Table of Contents to show all sections and subsections
  of the README.md
* Cleaned up some grammar and added some extra info in various
  places
* Ran through VS Code's markdownlint extension and adjusted some
  syntax accordingly
2019-10-09 13:44:52 -04:00
Lukáš Mešťan
539f49bb68 Merge pull request #74 from jorgesumle/master
Update text errors from README.md
2019-09-18 12:21:07 +02:00
Jorge Maldonado Ventura
10bc3106f6 Update text errors from README.md
Hyphens are necessary for compound adjectives
2019-09-18 11:21:05 +02:00
Lukáš Mešťan
7160e3c39d Update README.md 2019-09-17 18:10:16 +02:00
Lukáš Mešťan
f17cbd0ff7 Merge pull request #72 from keur/makefile_destdir
make: Use DESTDIR
2019-08-12 09:42:07 +02:00
Kevin Kuehler
a3cd429850 make: Use DESTDIR
This is more standard than forcing the user to specify the destination
directory as part of PREFIX.
2019-08-11 13:59:33 -07:00
Lukáš Mešťan
e069deaf8a Update FUNDING.yml 2019-06-07 19:01:29 +02:00
Lukáš Mešťan
b1285b828e Create FUNDING.yml 2019-05-28 08:47:17 +00:00
Tom Ice
c11bce17bd Merge pull request #71 from tomice/master
Added ability to save log as a JSON formatted file
2019-05-26 10:27:58 -04:00
Tom Ice
5f0bc1c7cf Removed GPG info from JSON and updated README pics
* The GPG settings don't play well with OS X if you don't have
  certain tools installed, so they were removed from the git log
  format settings for the JSON output.

* Pictures have been updated to reflect the new menu option.
2019-05-24 23:35:11 -04:00
Tom Ice
5f71b785ac Added ability to save log as a JSON formatted file
* The main feature of this commit is addressing the feature request
  of adding the ability to save the output as a file to use in other
  tools. I decided to use the JSON format as it's relatively straight
  forward and easy to create thanks to a few Google searches.

  The original feature request was to add the ability to output any of
  the options as a JSON/XML/YAML format. That said, because this entire project
  is relying only on built-in shell utilities, we kind of have to format stuff
  ourselves in relatively primitive tools such as awk, sed, and bash in order
  to adhere to the "spirit" of this codebase.

  It is possible to use Perl and/or Python, but that would defeat the purpose
  of this, in my opinion. The downside of not using these tools is that it
  might not be as robust and battle hardened as the others.

  AS SUCH, THIS FEATURE IS CURRENTLY EXPERIMENTAL.

  As people provide feedback, we can adjust this and possibly extend it to
  more options. For now, it respects _GIT_SINCE and _GIT_UNTIL. It does not
  respect variable expansion in paths, though, so saving it to a location such
  as "${my_save_location}" will fail.

* Made some of the variables a bit more robust by utilizing the -r flag to
  make the variables readonly. It should be noted that "local readonly" does
  not work, nor does "readonly local". The best way to do this is either via
  "local -r foo=bar" or "local foo=bar && readonly bar".

* Fixed a few comments describing how functions work.

* Added a .gitignore.

* Changed all functions to adhere to camelCase style for no real reason
  other than consistency and a few other minor things.

* Closes #31
2019-05-24 21:15:19 -04:00
Tom Ice
cdb3f20790 Fixing failed test that occurred after merging PR
* This is just a small change to make it so that the build passes
  tests. It is minor and does not affect the release functionality
2019-05-17 17:28:02 -04:00
Tom Ice
dd69477293 Merge pull request #69 from mhickman/master
Change format of _GIT_SINCE in help
2019-05-17 13:00:16 -04:00
Matt Hickman
4aef465e6b Change format of _GIT_SINCE in help
The format _GIT_SINCE is what `git --since` takes in
which is YYYY-MM-DD.

Ref: https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History
2019-05-17 09:54:27 -07:00
Tom Ice
81fce5cadf Updating README.md to reflect new theme(s) 2019-05-13 10:35:59 -04:00
Tom Ice
f3931eb1a3 Merge pull request #65 from Calinou/improve-interactive-menu
Improve the interactive menu
2019-05-13 10:31:03 -04:00
Tom Ice
bdfe3beb25 New default theme with toggle-able legacy theme
* This sets the newly proposed theme as the main theme. In order to
  switch back to the legacy theme, set _MENU_THEME to legacy.
  This feature is currently an experimental feature and may change
  in the future.

* Fixes documentation and updates test to reflect newly changed theme.
2019-05-12 19:32:11 -04:00
Tom Ice
90d118f09f Fixing some menu color issues 2019-05-10 22:55:42 -04:00
Tom Ice
d12c1c6c4f Added color scheme toggle-ability and updated docs
* You can now switch between the default theme and an alternative theme
  for those who would like a different look to the interactive menu.
  In order to set this, simply do export _MENU_THEME=alternative. Anything
  that isn't "alternative" will simply fall back to the default menu option.

* Fixed merge conflicts based on the latest master branch which added the
  contribution stats by branch option.

* Fixed tests, updated docs, and all that fun stuff.
2019-05-10 16:17:42 -04:00
Tom Ice
1282e4b46f Updating README.md 2019-05-10 13:18:12 -04:00
Tom Ice
96de74cf4f Merge pull request #67 from joshuadeguzman/feature-request/contribution-stats-by-branch
Add non-interactive detailed git stats for a specific branch
2019-05-10 12:48:55 -04:00
Joshua de Guzman
096fd86324 Add new feature in man page 2019-05-10 23:59:12 +08:00
Joshua de Guzman
dd6a23568e Add new feature in README 2019-05-10 23:50:32 +08:00
jdeguzman
48c062f8fa Prevent logging refs when checking branch existence 2019-05-10 18:57:04 +08:00
jdeguzman
c3194f77e3 Add interactive menu for the detailed stats by branch 2019-05-10 18:08:38 +08:00
jdeguzman
52f4eff27c Add on the current branch 2019-05-10 18:00:25 +08:00
jdeguzman
c7d456465e Optimize branch existence validator 2019-05-10 11:00:38 +08:00
Joshua de Guzman
e9f085f20e Add git stats by branch to the options and update unit test 2019-05-10 01:08:53 +08:00
Joshua de Guzman
625ec404bc Update validation rules 2019-05-10 00:24:16 +08:00
jdeguzman
e6ffee5850 Add branch existence validation 2019-05-09 20:17:57 +08:00
jdeguzman
2422a010c6 Add non interactive request for detailed stats by branch 2019-05-09 19:41:47 +08:00
Hugo Locurcio
749367701d Improve the interactive menu
This adds a `>` at the end of the message to denote the program
is waiting for user input.

This also tweaks colors for better readability.
2019-04-11 14:40:16 +02:00
Lukáš Mešťan
3d86fa9664 Merge pull request #64 from opencollective/opencollective
Activating Open Collective
2019-03-05 07:44:32 +01:00
Jess
a6a65faa8d Added backers and sponsors on the README 2019-03-02 10:12:36 -08:00
Lukáš Mešťan
0cc67fd4ac Merge pull request #63 from laurence6/master
Fix some items are not displayed
2019-02-19 19:13:22 +01:00
Laurence
3344a05237 Fix some items are not displayed 2019-02-18 19:58:26 -05:00
Lukáš Mešťan
da78123ca8 Update README.md 2019-02-07 21:27:25 +01:00
Lukáš Mešťan
ad50a915b0 Merge pull request #60 from loonies/makefile
Makefile improvements
2019-02-04 14:05:28 +01:00
Miodrag Tokić
88f970632f Add man page to reinstall target
Update man page on reinstall as well. Also remove unnecessary uninstall
as the "install" command handles this gracefully.
2019-02-04 12:42:21 +01:00
Miodrag Tokić
7f3220abb7 Remove unnecessary Git alias
Git is able to find binary by the prefixed "git" name.
2019-02-04 12:41:22 +01:00
Miodrag Tokić
7a9e9c7f85 Improve man install / uninstall
- Create man directory prior to installing the page
 - Do not force root ownership of the man page
 - Remove man page when uninstalling
2019-02-03 18:10:06 +01:00
Miodrag Tokić
190ae631e5 Straightforward binary removal
Remove binary using the full path instead of jumping to directory.
2019-02-03 18:06:31 +01:00
Miodrag Tokić
94ea505dbd Replace "mkdir" with "install"
Favour "install" over "mkdir" in installation scripts.
2019-02-03 18:04:13 +01:00
Miodrag Tokić
601986fbe1 Remove EXEC_FILES
Variable doesn't make much sense and makes the code more convoluted.
2019-02-03 17:57:28 +01:00
Miodrag Tokić
01f60821ea Help formatting 2019-02-03 17:44:18 +01:00
Lukáš Mešťan
6579c31047 Merge pull request #59 from tomice/master
Added internal documentation and minor cleanup
2019-02-02 19:47:58 +01:00
Tom Ice
e82339b777 Added internal documentation and minor cleanup
* All internal functions now have documentation describing what they are,
  what arguments they take, and what external variables are set in an effort
  to help others understand the codebase more quickly

* Changed a few lines where grep | wc -l occurred, as grep has a built-in
  option to do this: grep -c

* Removed a $* where the suggestReviewers function expected a string but
  never received one during the life of the program

* Adjusted some lines so they weren't quite as long, adjusted some variable
  names, and other minor cleanup
2019-02-01 13:51:21 -05:00
Lukáš Mešťan
f3f0ab4730 Update LICENSE 2019-01-19 13:37:04 +01:00
Lukáš Mešťan
258b52eda8 Merge pull request #58 from tomice/master
Fixed issue where signatures were parsed in logs
2019-01-17 14:43:49 +01:00
Tom Ice
187c03ae98 Fixed issue where signatures were parsed in logs
* When someone has the showSignature=true flag set in their .gitconfig
  file, gpg verifying signature related text would be parsed as if it
  was actual log information. This change ignores signature-related text
  by passing the -c log.showSignature=false option to git so it ignores
  a user's custom .gitconfig showSignature flag regardless as to what it
  is set to.

Resolves: Issue #52
2019-01-16 18:10:59 -05:00
25 changed files with 1973 additions and 1137 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
# These are supported funding model platforms

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

13
.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
*.json
*.db
.DS_Store*
._*
.*.swp
.*.swo
.Spotlight*
.Trash*
**/*~
nbproject/*
/tests/test-git/.git/
#/tests/test-git/*
!/tests/test-git/resetgit

View File

@@ -1,3 +1,3 @@
Lukas Mestan <lukas.mestan@gmail.com> Lukáš Mešťan <arzzen@users.noreply.github.com> Lukas <test@gmail.com> Lukáš <arzzen@users.noreply.github.com>
Lukas Mestan <lukas.mestan@gmail.com> arzzen Lukas <lukas@gmail.com> arzzen

View File

@@ -11,8 +11,6 @@ addons:
- cmake - cmake
install: install:
- git checkout ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- git branch --set-upstream-to origin/$TRAVIS_BRANCH
- git rev-parse HEAD - git rev-parse HEAD
script: make test script: make test

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM alpine
# Copy sources
COPY . /app
# Install required packages & build git-quick-stats
RUN apk add --no-cache bash git make ncurses util-linux \
&& cd /app \
&& make install \
&& rm -rf /app \
&& apk del --no-cache make \
&& mkdir -p /usr/local/bin \
&& echo -en "#!/bin/bash\nset -e\n[[ \"\${1::1}\" == '-' ]] && set -- /usr/bin/git quick-stats \"\$@\"\nexec \"\$@\"" \
> /usr/local/bin/docker-entrypoint \
&& chmod +x /usr/local/bin/docker-entrypoint
# Declare all variables usables by git-quick-stats
ENV _GIT_SINCE= \
_GIT_UNTIL= \
_GIT_LIMIT= \
_GIT_PATHSPEC= \
_MENU_THEME=default \
TERM=xterm-256color
WORKDIR /git
RUN git config --global --add safe.directory /git
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
CMD [ "/usr/bin/git", "quick-stats" ]

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2018 Lukáš Mešťan Copyright (c) 2024 git-quick-stats.sh
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,42 +1,43 @@
PREFIX ?= /usr/local PREFIX ?= /usr/local
_INSTDIR ?= $(DESTDIR)$(PREFIX)
BINDIR ?= $(_INSTDIR)/bin
MANDIR ?= $(_INSTDIR)/share/man
TASK_DONE = echo -e "\n✓ $@ done\n" TASK_DONE = echo -e "\n✓ $@ done\n"
# files that need mode 755 SHELL := $(shell which bash)
EXEC_FILES=git-quick-stats
.PHONY: test .PHONY: test
all: all:
@echo "usage: make install" @echo "Usage:"
@echo " make reinstall" @echo " make install"
@echo " make uninstall" @echo " make reinstall"
@echo " make test" @echo " make uninstall"
@echo " make test"
help: help:
$(MAKE) all $(MAKE) all
@$(TASK_DONE) @$(TASK_DONE)
install: install:
mkdir -p $(PREFIX)/bin install -d -m 0755 $(BINDIR)
install -m 0755 $(EXEC_FILES) $(PREFIX)/bin/$(EXEC_FILES) install -m 0755 git-quick-stats $(BINDIR)/git-quick-stats
git config --global alias.quick-stats '! $(PREFIX)/bin/$(EXEC_FILES)'
$(MAKE) man $(MAKE) man
@$(TASK_DONE) @$(TASK_DONE)
uninstall: uninstall:
test -d $(PREFIX)/bin && \ rm -f $(BINDIR)/git-quick-stats
cd $(PREFIX)/bin && \ rm -f $(MANDIR)/man1/git-quick-stats.1
rm -f $(EXEC_FILES) && \
git config --global --unset alias.quick-stats
@$(TASK_DONE) @$(TASK_DONE)
reinstall: reinstall:
@curl -s https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats > git-quick-stats @curl -sO https://raw.githubusercontent.com/git-quick-stats/git-quick-stats/master/git-quick-stats
$(MAKE) uninstall && \ @curl -sO https://raw.githubusercontent.com/git-quick-stats/git-quick-stats/master/git-quick-stats.1
$(MAKE) install $(MAKE) install
@$(TASK_DONE) @$(TASK_DONE)
man: man:
install -g 0 -o 0 -m 0644 git-quick-stats.1 /usr/share/man/man1/ install -d -m 0755 $(MANDIR)/man1/
install -m 0644 git-quick-stats.1 $(MANDIR)/man1/
test: test:
tests/commands_test.sh tests/commands_test.sh

397
README.md
View File

@@ -1,134 +1,252 @@
# GIT quick statistics [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20and%20efficient%20way%20to%20access%20various%20statistics%20in%20git%20repository&url=https://github.com/arzzen/git-quick-stat&via=arzzen&hashtags=git,stats,tool,statistics,developers)
## GIT quick statistics [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20and%20efficient%20way%20to%20access%20various%20statistics%20in%20git%20repository&url=https://github.com/arzzen/git-quick-stat&via=arzzen&hashtags=git,stats,tool,statistics,developers) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](https://formulae.brew.sh/formula/git-quick-stats#default)
[![Travis](https://api.travis-ci.org/arzzen/git-quick-stats.svg?branch=master)](https://travis-ci.org/arzzen/git-quick-stats) > `git-quick-stats` is a simple and efficient way to access various statistics in a git repository.
[![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](http://braumeister.org/formula/git-quick-stats) >
[![Linuxbrew package](https://repology.org/badge/version-for-repo/linuxbrew/git-quick-stats.svg)](https://repology.org/metapackage/git-quick-stats/packages) > Any git repository may contain tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because there are a gadzillion options to a gadzillion git commands - I don't think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
> `git quick-stats` is a simple and efficient way to access various statistics in git repository. ![mainMenuScreenshot](https://github.com/user-attachments/assets/05a20ff1-44f6-4e44-9d62-c2c089f9ff4e)
> Any git repository contains tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because of a gadzillion options to a gadzillion git commands I dont think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
## Table of Contents ## Table of Contents
[**Screenshots**](#screenshots) [**Screenshots**](#screenshots)
[**Installation**](#installation)
* [**Unix OS**](#unix-like-os)
* [**OS X**](#os-x-homebrew)
* [**Windows**](#windows-cygwin)
[**Usage**](#usage) [**Usage**](#usage)
* [**Git log since/until**](#git-log-since-until)
* [**Git log limit**](#git-log-limit) - [**Interactive**](#interactive)
* [**Git pathspec**](#git-pathspec) - [**Non-interactive**](#non-interactive)
* [**Tests**](#tests) - [**Command-line arguments**](#command-line-arguments)
- [**Git log since and until**](#git-log-since-and-until)
- [**Git log limit**](#git-log-limit)
- [**Git log options**](#git-log-options)
- [**Git pathspec**](#git-pathspec)
- [**Git merge view strategy**](#git-merge-view-strategy)
- [**Color themes**](#color-themes)
[**Installation**](#installation)
- [**UNIX and Linux**](#unix-and-linux)
- [**macOS**](#macos-homebrew)
- [**Windows**](#windows)
- [**Docker**](#docker)
[**System requirements**](#system-requirements) [**System requirements**](#system-requirements)
* [**Dependences**](#dependences)
[**Contribution**](#contribution) - [**Dependencies**](#dependencies)
[**FAQ**](#faq) [**FAQ**](#faq)
[**License**](#licensing) [**Contribution**](#contribution)
- [**Code reviews**](#code-reviews)
- [**Some tips for good pull requests**](#some-tips-for-good-pull-requests)
- [**Formatting**](#formatting)
[**Tests**](#tests)
[**Licensing**](#licensing)
[**Contributors**](#contributors)
- [**Backers**](#backers)
- [**Sponsors**](#sponsors)
## Screenshots ## Screenshots
![screenshot from 2017-04-02 17-10-21](https://cloud.githubusercontent.com/assets/6382002/24588459/bef0a1b8-17c8-11e7-8525-3ab5983b81dc.png) ![commitsByWeekdayScreenshot](https://github.com/user-attachments/assets/3a55f3ac-8801-4bbf-9b3a-92b53a64631e)
![screenshot from 2017-04-02 17-09-13](https://cloud.githubusercontent.com/assets/6382002/24588456/bec1278a-17c8-11e7-8835-39273da7bc99.png)
![screenshot from 2017-04-02 17-09-31](https://cloud.githubusercontent.com/assets/6382002/24588457/beece9f6-17c8-11e7-80a4-274ecd314a7e.png)
![screenshot from 2017-04-02 17-09-45](https://cloud.githubusercontent.com/assets/6382002/24588458/bef03656-17c8-11e7-82e6-30a5a11cfbb0.png)
![screenshot from 2017-04-02 17-08-28](https://cloud.githubusercontent.com/assets/6382002/24588460/bef0c2e2-17c8-11e7-88b2-a4033593c5d0.png)
![commitsByHourScreenshot](https://github.com/user-attachments/assets/d7de5280-8bb9-4391-9c6c-7e688f2df171)
## Usage ## Usage
### Interactive
`git-quick-stats` has a built-in interactive menu that can be executed as such:
```bash ```bash
git quick-stats
# or
git-quick-stats git-quick-stats
``` ```
Or you can use (non-interactive) direct execution: Or
`git quick-stats <optional-command-to-execute-directly>` ```bash
git quick-stats
```
### Non-interactive
For those who prefer to utilize command-line options, `git-quick-stats` also has a non-interactive mode supporting both short and long options:
```bash
git-quick-stats <optional-command-to-execute-directly>
```
Or
```bash
git quick-stats <optional-command-to-execute-directly>
```
### Command-line arguments
Possible arguments in short and long form: Possible arguments in short and long form:
``` ```bash
-r, --suggest-reviewers GENERATE OPTIONS
show the best people to contact to review code -T, --detailed-git-stats
-T, --detailed-git-stats give a detailed list of git stats
give a detailed list of git stats -R, --git-stats-by-branch
-d, --commits-per-day see detailed list of git stats by branch
displays a list of commits per day -c, --changelogs
-m, --commits-by-month see changelogs
displays a list of commits per month -L, --changelogs-by-author
-w, --commits-by-weekday see changelogs by author
displays a list of commits per weekday -S, --my-daily-stats
-o, --commits-by-hour see your current daily stats
displays a list of commits per hour -V, --csv-output-by-branch
-A, --commits-by-author-by-hour output daily stats by branch in CSV format
displays a list of commits per hour by author -j, --json-output
-a, --commits-per-author save git log as a JSON formatted file to a specified area
displays a list of commits per author
-S, --my-daily-stats LIST OPTIONS
see your current daily stats -b, --branch-tree
-C, --contributors show an ASCII graph of the git repo branch history
see a list of everyone who contributed to the repo -D, --branches-by-date
-b, --branch-tree show branches by date
show an ASCII graph of the git repo branch history -C, --contributors
-D, --branches-by-date see a list of everyone who contributed to the repo
show branches by date -n, --new-contributors
-c, --changelogs list everyone who made their first contribution since a specified date
see changelogs -a, --commits-per-author
-L, --changelogs-by-author displays a list of commits per author
see changelogs by author -d, --commits-per-day
-h, -?, --help displays a list of commits per day
display this help text in the terminal -Y, --commits-by-year
displays a list of commits per year
-m, --commits-by-month
displays a list of commits per month
-w, --commits-by-weekday
displays a list of commits per weekday
-W, --commits-by-author-by-weekday
displays a list of commits per weekday by author
-o, --commits-by-hour
displays a list of commits per hour
-A, --commits-by-author-by-hour
displays a list of commits per hour by author
-z, --commits-by-timezone
displays a list of commits per timezone
-Z, --commits-by-author-by-timezone
displays a list of commits per timezone by author
SUGGEST OPTIONS
-r, --suggest-reviewers
show the best people to contact to review code
-h, -?, --help
display this help text in the terminal
``` ```
#### Git log since / until ### Git log since and until
You can set variable `_GIT_SINCE`, `_GIT_UNTIL` and limit the git log You can set the variables `_GIT_SINCE` and/or `_GIT_UNTIL` before running `git-quick-stats` to limit the git log. These work similar to git's built-in `--since` and `--until` log options.
```bash ```bash
export _GIT_SINCE="2017-20-01" export _GIT_SINCE="2017-01-20"
export _GIT_UNTIL="2017-22-01" export _GIT_UNTIL="2017-01-22"
``` ```
then run `git quick-stats` (affect all stats, except "My daily status" and "Git changelogs" ) Once set, run `git quick-stats` as normal. Note that this affects all stats that parse the git log history until unset.
### Git log limit
#### Git log limit You can set variable `_GIT_LIMIT` for limited output. It will affect the "changelogs" and "branch tree" options. The default limit is `10`.
You can set variable `_GIT_LIMIT` for limited output (it will affect: "Git changelogs" and "Branch tree view" )
```bash ```bash
export _GIT_LIMIT=20 export _GIT_LIMIT=20
``` ```
#### Git pathspec ### Git log options
You can exclude directory from the stats by using [pathspec](https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec) You can set `_GIT_LOG_OPTIONS` for [git log options](https://git-scm.com/docs/git-log#_options):
```bash
export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
```
### Git pathspec
You can exclude a directory from the stats by using [pathspec](https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec)
```bash ```bash
export _GIT_PATHSPEC=':!directory' export _GIT_PATHSPEC=':!directory'
``` ```
You can also exclude files from the stats. Note that it works with any alphanumeric, glob, or regex that git respects.
```bash
export _GIT_PATHSPEC=':!package-lock.json'
```
### Git merge view strategy
You can set the variable `_GIT_MERGE_VIEW` to enable merge commits to be part of the stats by setting `_GIT_MERGE_VIEW` to `enable`. You can also choose to only show merge commits by setting `_GIT_MERGE_VIEW` to `exclusive`. Default is to not show merge commits. These work similar to git's built-in `--merges` and `--no-merges` log options.
```bash
export _GIT_MERGE_VIEW="enable"
export _GIT_MERGE_VIEW="exclusive"
```
### Git branch
You can set the variable `_GIT_BRANCH` to set the branch of the stats. Works with commands `--git-stats-by-branch` and `--csv-output-by-branch`.
```bash
export _GIT_BRANCH="master"
```
### Ignore authors
You can set the variable `_GIT_IGNORE_AUTHORS` to filter out specific authors. It will affect the "All contributors", ""Suggested code reviewers" and "New contributors" options.
```bash
export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
```
### Sorting contribution stats
You can sort contribution stats by field `name`, `commits`, `insertions`, `deletions`, or `lines` (total lines changed) and order (`asc`, `desc`). e.g.: `commits-desc`
```bash
export _GIT_SORT_BY="name-asc"
```
### Color themes
You can change to the legacy color scheme by toggling the variable `_MENU_THEME` between `default` and `legacy`.
You can completely disable the color theme by setting the `_MENU_THEME` variable to `none`.
```bash
export _MENU_THEME="legacy"
# or
export _MENU_THEME="none"
```
![legacyThemeScreenshot](https://github.com/user-attachments/assets/3b319c1a-827f-47b8-bbfa-b8b59a39deef)
## Installation ## Installation
#### Unix like OS ### Debian and Ubuntu
If you are on at least Debian Bullseye or Ubuntu Focal you can use apt for installation:
```bash ```bash
git clone https://github.com/arzzen/git-quick-stats.git && cd git-quick-stats apt install git-quick-stats
```
### UNIX and Linux
```bash
git clone https://github.com/git-quick-stats/git-quick-stats.git && cd git-quick-stats
sudo make install sudo make install
``` ```
@@ -144,59 +262,117 @@ For update/reinstall
sudo make reinstall sudo make reinstall
``` ```
#### OS X (homebrew) ### macOS (homebrew)
macOS requires GNU coreutils to be installed and for the non "g" aliased
versions to be exported to your path. The following is an example of how to
perform this if you are using Homebrew as your package manager.
```bash
brew install coreutils
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
```
From there, you can install via Homebrew as follows:
```bash ```bash
brew install git-quick-stats brew install git-quick-stats
``` ```
#### Windows (cygwin) Or you can follow the UNIX and Linux instructions if you wish.
* [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245) If you would like to default to using the GNU coreutils (recommended), then you
* [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6) can add `export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"` to
your applicable `~/.bash_profile`, `~/.zprofile`, or other relevant profile
based on the shell of your choice.
### Windows
If you are installing with Cygwin, use these scripts:
- [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
- [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6)
If you are wishing to use this with WSL, follow the UNIX and Linux instructions.
### Docker
You can use the Docker image provided:
- Build: `docker build -t arzzen/git-quick-stats .`
- Run interactive menu: `docker run --rm -it -v $(pwd):/git arzzen/git-quick-stats`
- Docker pull command: `docker pull arzzen/git-quick-stats` [docker repository](https://hub.docker.com/r/arzzen/git-quick-stats)
## System requirements ## System requirements
* Unix like OS with a proper shell - An OS with a Bash shell
* Tools we use: awk ; cat ; column ; echo ; git ; grep ; head ; seq ; sort ; tput ; tr ; uniq ; wc - Tools we use:
#### Dependences ```bash
awk
basename
cat
column
date
echo
git
grep
head
printf
seq
sort
tput
tr
uniq
```
* [`bsdmainutils`](https://packages.debian.org/sid/bsdmainutils) `apt install bsdmainutils` ### Dependencies
- [`bsdextrautils`](https://packages.debian.org/sid/bsdextrautils) `apt install bsdextrautils`
- [`coreutils`](https://packages.debian.org/sid/coreutils) `apt install coreutils`
- [`gawk`](https://packages.debian.org/sid/gawk) `apt install gawk`
- [`grep`](https://packages.debian.org/sid/grep) `apt install grep`
- [`ncurses-bin`](https://packages.debian.org/sid/ncurses-bin) `apt install ncurses-bin`
## FAQ ## FAQ
*Q:* I get some errors after run git-quick-stats in cygwin like `/usr/local/bin/git-quick-stats: line 2: $'\r': command not found` _Q:_ I get some errors after run git-quick-stats in cygwin like `/usr/local/bin/git-quick-stats: line 2: $'\r': command not found`
*A:* You can run dos2unix app in cygwin `/bin/dos2unix.exe /usr/local/bin/git-quick-stats`. This will convert it to Unix format and you then should be able to run it. _A:_ You can run the dos2unix app in cygwin as follows: `/bin/dos2unix.exe /usr/local/bin/git-quick-stats`. This will convert the script from the CR-LF convention that Microsoft uses to the LF convention that UNIX, OS X, and Linux use. You should then should be able to run it as normal.
_Q:_ How they could be used in a project with many git projects and statistics would show a summary of all git projects?
_A:_ If you want to include submodule logs, you can try using the following: `export _GIT_LOG_OPTIONS="-p --submodule=log"`
(more info about [git log --submodule](https://git-scm.com/docs/git-log#Documentation/git-log.txt---submoduleltformatgt))
## Contribution ## Contribution
Want to contribute? Great! First, read this page. Want to contribute? Great! First, read this page.
#### Code reviews ### Code reviews
All submissions, including submissions by project members, require review.</br>
We use Github pull requests for this purpose.
#### Some tips for good pull requests: All submissions, including submissions by project members, require review.</br>
* Use our code </br> We use GitHub pull requests for this purpose.
### Some tips for good pull requests
- Use our code </br>
When in doubt, try to stay true to the existing code of the project. When in doubt, try to stay true to the existing code of the project.
* Write a descriptive commit message. What problem are you solving and what - Write a descriptive commit message. What problem are you solving and what
are the consequences? Where and what did you test? Some good tips: are the consequences? Where and what did you test? Some good tips:
[here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message) [here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches). and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches).
* If your PR consists of multiple commits which are successive improvements / - If your PR consists of multiple commits which are successive improvements /
fixes to your first commit, consider squashing them into a single commit fixes to your first commit, consider squashing them into a single commit
(`git rebase -i`) such that your PR is a single commit on top of the current (`git rebase -i`) such that your PR is a single commit on top of the current
HEAD. This make reviewing the code so much easier, and our history more HEAD. This make reviewing the code so much easier, and our history more
readable. readable.
#### Formatting ### Formatting
This documentation is written using standard [markdown syntax](https://help.github.com/articles/markdown-basics/). Please submit your changes using the same syntax. This documentation is written using standard [markdown syntax](https://help.github.com/articles/markdown-basics/). Please submit your changes using the same syntax.
#### Tests ## Tests
[![codecov](https://codecov.io/gh/arzzen/git-quick-stats/branch/master/graph/badge.svg)](https://codecov.io/gh/arzzen/git-quick-stats) [![codecov](https://codecov.io/gh/arzzen/git-quick-stats/branch/master/graph/badge.svg)](https://codecov.io/gh/arzzen/git-quick-stats)
@@ -205,9 +381,36 @@ make test
``` ```
## Licensing ## Licensing
MIT see [LICENSE][] for the full license text. MIT see [LICENSE][] for the full license text.
[read this page]: http://github.com/arzzen/git-quick-stats/blob/master/docs/CONTRIBUTING.md [read this page]: http://github.com/git-quick-stats/git-quick-stats/blob/master/.github/CONTRIBUTING.md
[landing page]: http://arzzen.github.io/git-quick-stats [landing page]: https://git-quick-stats.sh
[LICENSE]: https://github.com/arzzen/git-quick-stats/blob/master/LICENSE [LICENSE]: https://github.com/git-quick-stats/git-quick-stats/blob/master/LICENSE
## Contributors
This project exists thanks to all the people who contribute.
[![contributors](https://opencollective.com/git-quick-stats/contributors.svg?width=890&button=false)](https://github.com/git-quick-stats/git-quick-stats/graphs/contributors)
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/git-quick-stats#backer)]
[![backers](https://opencollective.com/git-quick-stats/backers.svg?width=890)](https://opencollective.com/git-quick-stats#backers)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/git-quick-stats#sponsor)]
[![sponsor0](https://opencollective.com/git-quick-stats/sponsor/0/avatar.svg?v=1)](https://opencollective.com/git-quick-stats/sponsor/0/website)
[![sponsor1](https://opencollective.com/git-quick-stats/sponsor/1/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/1/website)
[![sponsor2](https://opencollective.com/git-quick-stats/sponsor/2/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/2/website)
[![sponsor3](https://opencollective.com/git-quick-stats/sponsor/3/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/3/website)
[![sponsor4](https://opencollective.com/git-quick-stats/sponsor/4/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/4/website)
[![sponsor5](https://opencollective.com/git-quick-stats/sponsor/5/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/5/website)
[![sponsor6](https://opencollective.com/git-quick-stats/sponsor/6/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/6/website)
[![sponsor7](https://opencollective.com/git-quick-stats/sponsor/7/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/7/website)
[![sponsor8](https://opencollective.com/git-quick-stats/sponsor/8/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/8/website)
[![sponsor9](https://opencollective.com/git-quick-stats/sponsor/9/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/9/website)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,509 +0,0 @@
/*!
* Start Bootstrap - Creative Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
html,
body {
width: 100%;
height: 100%;
}
body {
font-family: Merriweather,'Helvetica Neue',Arial,sans-serif;
}
hr {
max-width: 50px;
border-color: #f05f40;
border-width: 3px;
}
hr.light {
border-color: #fff;
}
a {
color: #f05f40;
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s;
}
a:hover,
a:focus {
color: #eb3812;
}
#about a {
color: rgba(52, 52, 52, .7);
}
#about a:hover,
#about a:focus {
color: rgb(52, 52, 52);
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
}
p {
margin-bottom: 20px;
font-size: 16px;
line-height: 1.5;
}
.bg-primary {
background-color: #f05f40;
}
.bg-dark {
color: #fff;
background-color: #222;
}
.text-faded {
color: rgba(255,255,255,.7);
}
section {
padding: 100px 0;
}
aside {
padding: 50px 0;
}
.no-padding {
padding: 0;
}
.navbar-default {
border-color: rgba(34,34,34,.05);
font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
background-color: #fff;
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s;
}
.navbar-default .navbar-header .navbar-brand {
text-transform: uppercase;
font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
font-weight: 700;
color: #2d8888;
}
.navbar-default .navbar-header .navbar-brand:hover,
.navbar-default .navbar-header .navbar-brand:focus {
color: #eb3812;
}
.navbar-default .nav > li>a,
.navbar-default .nav>li>a:focus {
text-transform: uppercase;
font-size: 13px;
font-weight: 700;
color: #222;
}
.navbar-default .nav > li>a:hover,
.navbar-default .nav>li>a:focus:hover {
color: #f05f40;
}
.navbar-default .nav > li.active>a,
.navbar-default .nav>li.active>a:focus {
color: #f05f40!important;
background-color: transparent;
}
.navbar-default .nav > li.active>a:hover,
.navbar-default .nav>li.active>a:focus:hover {
background-color: transparent;
}
@media(min-width:768px) {
.navbar-default {
border-color: rgba(255,255,255,.3);
background-color: transparent;
}
.navbar-default .navbar-header .navbar-brand {
color: rgba(255,255,255,.7);
}
.navbar-default .navbar-header .navbar-brand:hover,
.navbar-default .navbar-header .navbar-brand:focus {
color: #fff;
}
.navbar-default .nav > li>a,
.navbar-default .nav>li>a:focus {
color: rgba(255,255,255,.7);
}
.navbar-default .nav > li>a:hover,
.navbar-default .nav>li>a:focus:hover {
color: #fff;
}
.navbar-default.affix {
border-color: rgba(34,34,34,.05);
background-color: #fff;
}
.navbar-default.affix .navbar-header .navbar-brand {
font-size: 14px;
color: #f05f40;
}
.navbar-default.affix .navbar-header .navbar-brand:hover,
.navbar-default.affix .navbar-header .navbar-brand:focus {
color: #eb3812;
}
.navbar-default.affix .nav > li>a,
.navbar-default.affix .nav>li>a:focus {
color: #222;
}
.navbar-default.affix .nav > li>a:hover,
.navbar-default.affix .nav>li>a:focus:hover {
color: #f05f40;
}
}
header {
position: relative;
width: 100%;
min-height: auto;
text-align: center;
color: #fff;
background-color: #2f2d2f;
/*background-color: #2c3333;*/
/*background-image: url(../img/header.jpg);*/
/*background-position: center;*/
/*-webkit-background-size: cover;*/
/*-moz-background-size: cover;*/
/*background-size: cover;*/
/*-o-background-size: cover;*/
}
header .header-content {
position: relative;
width: 100%;
padding: 100px 15px;
text-align: center;
}
header .header-content .header-content-inner h1 {
margin-top: 0;
margin-bottom: 0;
/* text-transform: uppercase; */
font-weight: 700;
font-size: 120px;
}
header .header-content .header-content-inner hr {
margin: 30px auto;
}
header .header-content .header-content-inner p {
margin-bottom: 50px;
font-size: 16px;
font-weight: 300;
color: rgba(255,255,255,.7);
}
@media(min-width:768px) {
header {
min-height: 100%;
}
header .header-content {
position: absolute;
top: 50%;
padding: 0 50px;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
header .header-content .header-content-inner {
margin-right: auto;
margin-left: auto;
max-width: 1000px;
}
header .header-content .header-content-inner p {
margin-right: auto;
margin-left: auto;
max-width: 80%;
font-size: 18px;
}
}
.section-heading {
margin-top: 0;
}
.service-box {
margin: 50px auto 0;
max-width: 400px;
}
@media(min-width:992px) {
.service-box {
margin: 20px auto 0;
}
}
.service-box p {
margin-bottom: 0;
}
.portfolio-box {
display: block;
position: relative;
margin: 0 auto;
max-width: 650px;
}
.portfolio-box .portfolio-box-caption {
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
opacity: 0;
background: rgba(240,95,64,.9);
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content {
position: absolute;
top: 50%;
width: 100%;
text-align: center;
transform: translateY(-50%);
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category,
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
padding: 0 15px;
font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
text-transform: uppercase;
font-size: 14px;
font-weight: 600;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 18px;
}
.portfolio-box:hover .portfolio-box-caption {
opacity: 1;
}
@media(min-width:768px) {
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
font-size: 16px;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 22px;
}
}
.call-to-action h2 {
margin: 0 auto 20px;
}
.text-primary {
color: #f05f40;
}
.no-gutter > [class*=col-] {
padding-right: 0;
padding-left: 0;
}
.btn-default {
border-color: #fff;
color: #222;
background-color: #fff;
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s;
}
.btn-default:hover,
.btn-default:focus,
.btn-default.focus,
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
border-color: #ededed;
color: #222;
background-color: #f2f2f2;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
border-color: #fff;
background-color: #fff;
}
.btn-default .badge {
color: #fff;
background-color: #222;
}
.btn-primary {
border-color: #f05f40;
color: #fff;
background-color: #2d8888;
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #fff;
background-color: #68a9a9;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
border-color: #f05f40;
background-color: #f05f40;
}
.btn-primary .badge {
color: #f05f40;
background-color: #fff;
}
.btn {
border: 0;
border-radius: 300px;
text-transform: uppercase;
font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
font-weight: 700;
font-size: 1.4em;
}
.btn-xl {
padding: 15px 30px;
}
::-moz-selection {
text-shadow: none;
color: #fff;
background: #222;
}
::selection {
text-shadow: none;
color: #fff;
background: #222;
}
img::selection {
color: #fff;
background: 0 0;
}
img::-moz-selection {
color: #fff;
background: 0 0;
}
body {
webkit-tap-highlight-color: #222;
}
#map {
height: 300px;
overflow: visible;
position: relative;
}
.subtitle {
color: #b1b1b1;
}
.logo {
width: 50%;
padding-bottom: 5px;
}
.screencap {
width: 80%;
padding-top: 20px;
padding-bottom: 30px;
}

View File

@@ -1,81 +0,0 @@
/*!
* The code below adds the modal functionality of the Freelancer Bootstrap Theme
* and was originally part of this theme.
*
*
* Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
body {
overflow-x: hidden;
}
.img-centered {
margin: 0 auto;
}
.portfolio-modal .modal-content {
padding: 100px 0;
min-height: 100%;
border: 0;
border-radius: 0;
text-align: center;
background-clip: border-box;
-webkit-box-shadow: none;
box-shadow: none;
}
.portfolio-modal .modal-content h2 {
margin: 0;
font-size: 3em;
}
.portfolio-modal .modal-content img {
margin-bottom: 30px;
}
.portfolio-modal .modal-content .item-details {
margin: 30px 0;
}
.portfolio-modal .close-modal {
position: absolute;
top: 25px;
right: 25px;
width: 75px;
height: 75px;
background-color: transparent;
cursor: pointer;
}
.portfolio-modal .close-modal:hover {
opacity: .3;
}
.portfolio-modal .close-modal .lr {
z-index: 1051;
width: 1px;
height: 75px;
margin-left: 35px;
background-color: #2c3e50;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.portfolio-modal .close-modal .lr .rl {
z-index: 1052;
width: 1px;
height: 75px;
background-color: #2c3e50;
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.portfolio-modal .modal-backdrop {
display: none;
opacity: 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,35 +0,0 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Lukas Mestan">
<meta name="description" content="Commandline GIT statistics">
<title>git quick stats</title>
<link rel="shortcut icon" href="favicon.ico?v=1" type="image/x-icon">
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link rel="stylesheet" href="css/animate.min.css" type="text/css">
<link rel="stylesheet" href="css/creative.css" type="text/css">
<link rel="stylesheet" href="css/modals.css" type="text/css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<meta http-equiv="refresh" content="0;url=https://lukasmestan.com/git-quick-stats/">
</head>
<body id="page-top">
<header>
<div class="header-content">
<div class="header-content-inner">
<h1>git quick stats</h1>
<h3 class="subtitle"> simple and efficient way to access various statistics in git repository</h3>
<img class="screencap" src="bg.png" \>
<br>
<a href="https://github.com/arzzen/git-quick-stats" class="btn btn-primary btn-xl page-scroll">download</a>
</div>
</div>
</header>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
.TH git-quick-stats "1" "January 2019" "git-quick-stats" "User Commands" .TH git-quick-stats "1" "June 2025" "git-quick-stats" "User Commands"
.SH NAME .SH NAME
.B git\-quick\-stats .B git\-quick\-stats
\- Simple and efficient way to access various stats in a git repository. \- Simple and efficient way to access various stats in a git repository.
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
For non\-interactive mode: For non\-interactive mode:
.B git\-quick\-stats [OPTIONS] .B git\-quick\-stats [OPTIONS]
.PP .PP
For interactive mode: For interactive mode:
.B git-quick-stats .B git-quick-stats
.PP .PP
.SH DESCRIPTION .SH DESCRIPTION
@@ -17,67 +17,16 @@ and files. Extracting this information is not always trivial, mostly because
of a gadzillion options to a gadzillion git commands. of a gadzillion options to a gadzillion git commands.
This program allows you to see detailed information about a git repository. This program allows you to see detailed information about a git repository.
.PP .PP
.SH OPTIONS .SH GENERATE OPTIONS
.HP
\fB\-r\fR, \fB\-\-suggest\-reviewers\fR
.IP
show the best people to contact to review code
.HP
.PP
.PP .PP
\fB\-T\fR, \fB\-\-detailed\-git\-stats\fR \fB\-T\fR, \fB\-\-detailed\-git\-stats\fR
.IP .IP
give a detailed list of git stats give a detailed list of git stats
.HP .HP
.PP .PP
\fB\-d\fR, \fB\-\-commits\-per\-day\fR \fB\-R\fR, \fB\-\-git\-stats\-by\-branch\fR
.IP .IP
displays a list of commits per day see detailed list of git stats by branch
.HP
.PP
\fB\-m\fR, \fB\-\-commits\-by\-month\fR
.IP
displays a list of commits per month
.HP
.PP
\fB\-w\fR, \fB\-\-commits\-by\-weekday\fR
.IP
displays a list of commits per weekday
.HP
.PP
\fB\-o\fR, \fB\-\-commits\-by\-hour\fR
.IP
displays a list of commits per hour
.HP
.PP
\fB\-A\fR, \fB\-\-commits\-by\-author\-by\-hour\fR
.IP
displays a list of commits per hour by author
.HP
.PP
\fB\-a\fR, \fB\-\-commits\-per\-author\fR
.IP
displays a list of commits per author
.HP
.PP
\fB\-S\fR, \fB\-\-my\-daily\-stats\fR
.IP
see your current daily stats
.HP
.PP
\fB\-C\fR, \fB\-\-contributors\fR
.IP
see a list of everyone who contributed to the repo
.HP
.PP
\fB\-b\fR, \fB\-\-branch\-tree\fR
.IP
show an ASCII graph of the git repo branch history
.HP
.PP
\fB\-D\fR, \fB\-\-branches\-by\-date\fR
.IP
show branches by date
.HP .HP
.PP .PP
\fB\-c\fR, \fB\-\-changelogs\fR \fB\-c\fR, \fB\-\-changelogs\fR
@@ -90,24 +39,175 @@ see changelogs
see changelogs by author see changelogs by author
.HP .HP
.PP .PP
\fB\-S\fR, \fB\-\-my\-daily\-stats\fR
.IP
see your current daily stats
.HP
.PP
\fB\-V\fR, \fB\-\-csv\-output\-by\-branch\fR
.IP
output daily stats by branch in CSV format
.HP
.PP
\fB\-j\fR, \fB\-\-json\-output\fR
.IP
save git log as a JSON formatted file to a specified area
.HP
.SH LIST OPTIONS
.PP
\fB\-b\fR, \fB\-\-branch\-tree\fR
.IP
show an ASCII graph of the git repo branch history
.HP
.PP
\fB\-D\fR, \fB\-\-branches\-by\-date\fR
.IP
show branches by date
.HP
.PP
\fB\-C\fR, \fB\-\-contributors\fR
.IP
see a list of everyone who contributed to the repo
.HP
.PP
\fB\-n\fR, \fB\-\-new\-contributors\fR
.IP
list everyone who made their first contribution since a specified date
.HP
.PP
\fB\-a\fR, \fB\-\-commits\-per\-author\fR
.IP
displays a list of commits per author
.HP
.PP
\fB\-d\fR, \fB\-\-commits\-per\-day\fR
.IP
displays a list of commits per day
.HP
.PP
\fB\-m\fR, \fB\-\-commits\-by\-month\fR
.IP
displays a list of commits per month
.HP
.PP
\fB\-Y\fR, \fB\-\-commits\-by\-year\fR
.IP
displays a list of commits per year
.HP
.PP
\fB\-w\fR, \fB\-\-commits\-by\-weekday\fR
.IP
displays a list of commits per weekday
.HP
.PP
\fB\-W\fR, \fB\-\-commits\-by\-author\-by\-weekday\fR
.IP
displays a list of commits per weekday by author
.HP
.PP
\fB\-o\fR, \fB\-\-commits\-by\-hour\fR
.IP
displays a list of commits per hour
.HP
.PP
\fB\-A\fR, \fB\-\-commits\-by\-author\-by\-hour\fR
.IP
displays a list of commits per hour by author
.HP
.PP
\fB\-z\fR, \fB\-\-commits\-by\-timezone\fR
.IP
displays a list of commits per timezone
.HP
.PP
\fB\-Z\fR, \fB\-\-commits\-by\-author\-by\-timezone\fR
.IP
displays a list of commits per timezone by author
.HP
.PP
\fB\-\-activity\-calendar\fR
.IP
displays a calendar-style grid of commit activity per day-of-week and month for a selected author.
.HP
.SH SUGGEST OPTIONS
.PP
\fB\-r\fR, \fB\-\-suggest\-reviewers\fR
.IP
show the best people to contact to review code
.HP
.PP
\fB\-h\fR, \-?, \fB\-\-help\fR \fB\-h\fR, \-?, \fB\-\-help\fR
.IP .IP
display this help text in the terminal display this help text in the terminal
.PP .PP
.SH ADDITIONAL USAGE .SH ADDITIONAL USAGE
You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log, example: You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log, example:
.IP
.PP .PP
.B export _GIT_SINCE="2017\-20\-01" .B export _GIT_SINCE="2017\-01\-20"
.IP
.PP .PP
You can set _GIT_LIMIT for limited output log, example: You can set _GIT_LIMIT for limited output log, example:
.PP .PP
.B export _GIT_LIMIT=20 .B export _GIT_LIMIT=20
.PP .PP
You can exclude a directory from the stats by using pathspec, example: You can set _GIT_LOG_OPTIONS for git log options, example:
.PP .PP
.B export _GIT_PATHSPEC=':!directory' .B export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
.PP
You can exclude directories or files from the stats by using pathspec, example:
.PP
.B export _GIT_PATHSPEC=':!pattern'
.PP
You can set _GIT_MERGE_VIEW to show merge commits with normal commits, example:
.PP
.B export _GIT_MERGE_VIEW="enable"
.PP
You can also set _GIT_MERGE_VIEW to only show merge commits, example:
.PP
.B export _GIT_MERGE_VIEW="exclusive"
.PP
You can sort contribution stats by field "name", "commits", "insertions", "deletions", or "lines" (total lines changed) and order ("asc", "desc"). e.g.: "commits-desc"
.PP
.B export _GIT_SORT_BY="name-asc"
.PP
You can change to the legacy color scheme by toggling the variable "_MENU_THEME" between "default" and "legacy". You can completely disable the color theme by setting the "_MENU_THEME" variable to "none", example:
.PP
.B export _MENU_THEME=legacy
.PP
or
.B export _MENU_THEME=none
.PP
You can set _GIT_BRANCH to set the branch of the stats, example:
.PP
.B export _GIT_BRANCH="master"
.PP
.SH Calendar activity output
.PP
\fBactivity-calendar\fR outputs a visual grid of commit activity for a selected author, grouped by day-of-week (rows: Mon..Sun) and month (columns: Jan..Dec). Each cell is 3 characters wide, separated by one space.
.PP
Sample output:
.PP
.nf
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Mon ▓▓▓ ░░░ ▒▒▒ ░░░ ░░░ ▒▒▒ ▓▓▓ ░░░ ░░░ ▓▓▓ ▒▒▒ ▒▒▒
Tue ▒▒▒ ░░░ ▒▒▒ ░░░ ▒▒▒ ░░░ ▒▒▒ ▓▓▓ ▒▒▒ ░░░ ░░░ ░░░
Wed ░░░ ▓▓▓ ░░░ ▓▓▓ ▒▒▒ ░░░ ░░░ ▒▒▒ ░░░ ░░░ ▓▓▓ ░░░
Thu ░░░ ▒▒▒ ░░░ ░░░ ▒▒▒ ░░░ ▓▓▓ ▒▒▒ ▒▒▒ ░░░ ░░░ ▒▒▒
Fri ▒▒▒ ░░░ ▒▒▒ ▓▓▓ ░░░ ▓▓▓ ▒▒▒ ░░░ ▒▒▒ ░░░ ▒▒▒ ░░░
Sat ░░░ ░░░ ▒▒▒ ░░░ ░░░ ░░░ ▒▒▒ ░░░ ▒▒▒ ▓▓▓ ▒▒▒ ░░░
Sun ▓▓▓ ░░░ ▓▓▓ ░░░ ░░░ ▓▓▓ ░░░ ▒▒▒ ░░░ ░░░ ▓▓▓ ░░░
Legend: ... = 0 ░░░ = 12 ▒▒▒ = 35 ▓▓▓ = 6+ commits
.PP
You can set _GIT_IGNORE_AUTHORS to filter out specific authors, example:
.PP
.B export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
. .
.fi .fi
.PP
.SH SEE ALSO
.BR git (1)
.PP
Project homepage:
.UR https://github.com/git-quick-stats/git-quick-stats
.UE

View File

@@ -17,12 +17,16 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set -o nounset
export DISCOVERONLY=${DISCOVERONLY:-} export DISCOVERONLY=${DISCOVERONLY:-}
export DEBUG=${DEBUG:-} export DEBUG=${DEBUG:-}
export STOP=${STOP:-} export STOP=${STOP:-}
export INVARIANT=${INVARIANT:-} export INVARIANT=${INVARIANT:-}
export CONTINUE=${CONTINUE:-} export CONTINUE=${CONTINUE:-}
GREP=${GREP:-grep}
args="$(getopt -n "$0" -l \ args="$(getopt -n "$0" -l \
verbose,help,stop,discover,invariant,continue vhxdic $*)" \ verbose,help,stop,discover,invariant,continue vhxdic $*)" \
|| exit -1 || exit -1
@@ -75,7 +79,7 @@ assert_end() {
tests_endtime="$(date +%s%N)" tests_endtime="$(date +%s%N)"
# required visible decimal place for seconds (leading zeros if needed) # required visible decimal place for seconds (leading zeros if needed)
local tests_time="$( \ local tests_time="$( \
printf "%010d" "$(( ${tests_endtime/%N/000000000} printf "%010d" "$(( ${tests_endtime/%N/000000000}
- ${tests_starttime/%N/000000000} ))")" # in ns - ${tests_starttime/%N/000000000} ))")" # in ns
tests="$tests_ran ${*:+$* }tests" tests="$tests_ran ${*:+$* }tests"
[[ -n "$DISCOVERONLY" ]] && echo "collected $tests." && _assert_reset && return [[ -n "$DISCOVERONLY" ]] && echo "collected $tests." && _assert_reset && return
@@ -101,7 +105,7 @@ assert_end() {
assert() { assert() {
# assert <command> <expected stdout> [stdin] # assert <command> <expected stdout> [stdin]
(( tests_ran++ )) || : (( tests_ran++ )) || :
[[ -z "$DISCOVERONLY" ]] || return [[ -z "$DISCOVERONLY" ]] || return 0
expected=$(echo -ne "${2:-}") expected=$(echo -ne "${2:-}")
result="$(eval 2>/dev/null $1 <<< ${3:-})" || true result="$(eval 2>/dev/null $1 <<< ${3:-})" || true
if [[ "$result" == "$expected" ]]; then if [[ "$result" == "$expected" ]]; then
@@ -111,13 +115,13 @@ assert() {
result="$(sed -e :a -e '$!N;s/\n/\\n/;ta' <<< "$result")" result="$(sed -e :a -e '$!N;s/\n/\\n/;ta' <<< "$result")"
[[ -z "$result" ]] && result="nothing" || result="\"$result\"" [[ -z "$result" ]] && result="nothing" || result="\"$result\""
[[ -z "$2" ]] && expected="nothing" || expected="\"$2\"" [[ -z "$2" ]] && expected="nothing" || expected="\"$2\""
_assert_fail "expected $expected${_indent}got $result" "$1" "$3" _assert_fail "expected $expected${_indent}got $result" "$1" "${3:-}"
} }
assert_raises() { assert_raises() {
# assert_raises <command> <expected code> [stdin] # assert_raises <command> <expected code> [stdin]
(( tests_ran++ )) || : (( tests_ran++ )) || :
[[ -z "$DISCOVERONLY" ]] || return [[ -z "$DISCOVERONLY" ]] || return 0
status=0 status=0
(eval $1 <<< ${3:-}) > /dev/null 2>&1 || status=$? (eval $1 <<< ${3:-}) > /dev/null 2>&1 || status=$?
expected=${2:-0} expected=${2:-0}
@@ -125,19 +129,24 @@ assert_raises() {
[[ -z "$DEBUG" ]] || echo -n . [[ -z "$DEBUG" ]] || echo -n .
return return
fi fi
_assert_fail "program terminated with code $status instead of $expected" "$1" "$3" _assert_fail "program terminated with code $status instead of $expected" "$1" "${3:-}"
}
assert_success() {
# assert_success <command>
assert_raises "$1" 0
} }
# _assert_with_grep <grep modifiers> <command> <expected output...> # _assert_with_grep <grep modifiers> <command> <expected output...>
_assert_with_grep() { _assert_with_grep() {
local grep_modifier="$1" local grep_modifier="$1"
local output="$($2)" local output="$($2)"
local exitcode="$4" || 0 local exitcode=0
shift 2 shift 2
while [ $# != 0 ]; do while [ $# != 0 ]; do
assert_raises "echo '$output' | $GREP $grep_modifier '$1'" $exitcode || return 1 assert_raises "echo '$output' | $GREP $grep_modifier '$1'" $exitcode || return 1
shift shift
done done
} }

View File

@@ -1,19 +1,123 @@
#!/bin/bash #!/bin/bash
# Verify we are in a git repo. Create one if not
# FIXME: All the paths are hardcoded currently and will break if anything
# in this chain moves or gets executed elsewhere. Adjust all of these so
# pathing does not matter as much such as creating a TOP variable that
# does something like TOP=$(cd "$(dirname "$0")" || exit ; pwd -P)
# or maybe leverages Make to handle these as test targets
./tests/test-git/resetgit
. tests/assert.sh -v . tests/assert.sh -v
src="./git-quick-stats" src="./git-quick-stats"
#assert "$src fail" "Invalid argument\n\nNAME\n git-quick-stats - Simple and efficient way to access various stats in a git repo\n\nSYNOPSIS\n For non-interactive mode: git-quick-stats [OPTIONS]\n For interactive mode: git-quick-stats\n\nDESCRIPTION\n Any git repository contains tons of information about commits, contributors,\n and files. Extracting this information is not always trivial, mostly because\n of a gadzillion options to a gadzillion git commands.\n\n This program allows you to see detailed information about a git repository.\n\nOPTIONS\n suggestReviewers - see best people to contact to review code\n detailedGitStats - displays a detailed list of git status\n commitsPerDay - displays a list of commits per day\n commitsByMonth - displays a list of commits per month\n commitsByWeekday - displays a list of commits per weekday\n commitsByHour - displays a list of commits per hour\n commitsByAuthorByHour - see a list of commits per hour by author\n commitsPerAuthor - displays a list of commits per author\n myDailyStats - see your current daily stats\n contributors - see a list of all contributors\n branchTree - see an ASCII graph of the git repo\n branchesByDate - show branches by date\n changelogs - see changelogs\n changelogsByAuthor - see changelogs by author\n\nADDITIONAL USAGE\n You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log\n ex: export _GIT_SINCE=2017-20-01\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude a directory from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!directory'\n \nCONTRIBUTION\n For details regarding contribution, please see the contribution.md document\n\nLICENSE\n This is under the MIT license. See LICENSE in the repo for more info" assert "$src fail" "Invalid argument: fail
assert "$src fail" "Invalid argument\n\nNAME\n git-quick-stats - Simple and efficient way to access various stats in a git repo\n\nSYNOPSIS\n For non-interactive mode: git-quick-stats [OPTIONS]\n For interactive mode: git-quick-stats\n\nDESCRIPTION\n Any git repository contains tons of information about commits, contributors,\n and files. Extracting this information is not always trivial, mostly because\n of a gadzillion options to a gadzillion git commands.\n\n This program allows you to see detailed information about a git repository.\n\nOPTIONS\n -r, --suggest-reviewers\n show the best people to contact to review code\n -T, --detailed-git-stats\n give a detailed list of git stats\n -d, --commits-per-day\n displays a list of commits per day\n -m, --commits-by-month\n displays a list of commits per month\n -w, --commits-by-weekday\n displays a list of commits per weekday\n -o, --commits-by-hour\n displays a list of commits per hour\n -A, --commits-by-author-by-hour\n displays a list of commits per hour by author\n -a, --commits-per-author\n displays a list of commits per author\n -S, --my-daily-stats\n see your current daily stats\n -C, --contributors\n see a list of everyone who contributed to the repo\n -b, --branch-tree\n show an ASCII graph of the git repo branch history\n -D, --branches-by-date\n show branches by date\n -c, --changelogs\n see changelogs\n -L, --changelogs-by-author\n see changelogs by author\n -h, -?, --help\n display this help text in the terminal\n\nADDITIONAL USAGE\n You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log\n ex: export _GIT_SINCE=\"2017-20-01\"\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude a directory from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!directory'"
NAME
git-quick-stats - Simple and efficient way to access various stats in a git repo
SYNOPSIS
For non-interactive mode: git-quick-stats [OPTIONS]
For interactive mode: git-quick-stats
DESCRIPTION
Any git repository contains tons of information about commits, contributors,
and files. Extracting this information is not always trivial, mostly because
of a gadzillion options to a gadzillion git commands.
This program allows you to see detailed information about a git repository.
GENERATE OPTIONS
-T, --detailed-git-stats
give a detailed list of git stats
-R, --git-stats-by-branch
see detailed list of git stats by branch
-c, --changelogs
see changelogs
-L, --changelogs-by-author
see changelogs by author
-S, --my-daily-stats
see your current daily stats
-V, --csv-output-by-branch
output daily stats by branch in CSV format
-j, --json-output
save git log as a JSON formatted file to a specified area
LIST OPTIONS
-b, --branch-tree
show an ASCII graph of the git repo branch history
-D, --branches-by-date
show branches by date
-C, --contributors
see a list of everyone who contributed to the repo
-n, --new-contributors
list everyone who made their first contribution since a specified date
-a, --commits-per-author
displays a list of commits per author
-d, --commits-per-day
displays a list of commits per day
-m, --commits-by-month
displays a list of commits per month
-Y, --commits-by-year
displays a list of commits per year
-w, --commits-by-weekday
displays a list of commits per weekday
-W, --commits-by-author-by-weekday
displays a list of commits per weekday by author
-o, --commits-by-hour
displays a list of commits per hour
-A, --commits-by-author-by-hour
displays a list of commits per hour by author
-z, --commits-by-timezone
displays a list of commits per timezone
-Z, --commits-by-author-by-timezone
displays a list of commits per timezone by author
SUGGEST OPTIONS
-r, --suggest-reviewers
show the best people to contact to review code
-h, -?, --help
display this help text in the terminal
ADDITIONAL USAGE
You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log
ex: export _GIT_SINCE=\"2017-01-20\"
You can set _GIT_LIMIT for limited output log
ex: export _GIT_LIMIT=20
You can set _GIT_LOG_OPTIONS for git log options
ex: export _GIT_LOG_OPTIONS=\"--ignore-all-space --ignore-blank-lines\"
You can exclude directories or files from the stats by using pathspec
ex: export _GIT_PATHSPEC=':!pattern'
You can set _GIT_MERGE_VIEW to view merge commits with normal commits
ex: export _GIT_MERGE_VIEW=enable
You can also set _GIT_MERGE_VIEW to only show merge commits
ex: export _GIT_MERGE_VIEW=exclusive
You can change to the legacy color scheme by toggling the variable \"_MENU_THEME\" between \"default\" and \"legacy\".
You can completely disable the color theme by setting the \"_MENU_THEME\" variable to \"none\".
ex: export _MENU_THEME=legacy
You can set _GIT_BRANCH to set the branch of the stats
ex: export _GIT_BRANCH=master
You can set _GIT_IGNORE_AUTHORS to filter out specific authors
ex: export _GIT_IGNORE_AUTHORS=\"(author1|author2)\"
You can sort contribution stats by field \"name\", \"commits\", \"insertions\", \"deletions\", or \"lines\" - total lines changed and order - \"asc\", \"desc\"
ex: export _GIT_SORT_BY=\"name-asc\""
assert_raises "$src fail" 1 assert_raises "$src fail" 1
assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)" 127 assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)"
assert_raises "$src --suggest-reviewers" 0 assert_success "$src --suggest-reviewers"
assert_contains "$src --detailed-git-stats" "Contribution stats" 127 assert_contains "$src --detailed-git-stats" "Contribution stats (by author) on the current branch"
assert_raises "$src --detailed-git-stats" 0 assert_success "$src --detailed-git-stats"
assert_contains "$src --commits-per-day" "Git commits per date" 127 assert_contains "$src --commits-per-day" "Git commits per date"
assert_raises "$src --commits-per-day" 0 assert_success "$src --commits-per-day"
assert_startswith "$src --commits-by-year" "Git commits by year"
assert_success "$src --commits-by-year"
export LC_TIME=POSIX
assert_startswith "$src --commits-by-year" "Git commits by year"
assert_success "$src --commits-by-year"
assert_end assert_end

16
tests/test-git/resetgit Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Initialises a new local Git repo for test purpose if one does not exist already
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
{
git init
git config user.name "$(printf %s 'Test Git,\nfor test purpose')"
git config user.email "TestGit\o/@example.org"
printf 'test-git\n========\n' > README.md
git add README.md
git commit -m 'added readme (o\w/o)' -m 'in markdown, no \r\n, only \n' -m 'a very "simple" readme'
testChars="$(printf 'tab [%b] form feed [%b] line feed [%b] carriage return [%b]' '\x09' '\x0C' '\x0A' '\x0D')"
git notes add -m 'Some notes' -m 'out of ascii: été au cœur' -m "$testChars"
git log
} >/dev/null 2>&1
fi