Commit Graph

114 Commits

Author SHA1 Message Date
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
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
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
Rui Chen
cd6d67df06 improve macos error message wrt gnu date 2024-04-28 11:17:22 -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
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
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
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
s-okita
2ecb296442 Merge branch 'arzzen:master' into master 2023-06-07 02:42:22 +09: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
pyxide
d8346210a4 fix: json format output with multiline content 2022-07-11 19:15:07 +02: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
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
Matthieu Treussart
d2b273eead Export CSV of detailedGitStats 2021-05-20 05:25:09 +02:00
Matthieu Treussart
08d1a5a6e3 Set git branch in options 2021-05-18 21:51:40 +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
arzzen
3f0befcd07 fix shortlog filter 2021-04-02 13:34:46 +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
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
Denys Havrysh
9f9617b88b fix: correct localized decimal percent numbers 2020-12-16 17:28:13 +02:00
Michael Czigler
3fd0ee2453 usage: remove non-POSIX compliant features 2020-07-23 09:33:37 -04:00
Michael Czigler
cd38c40fe8 usage: remove non-POSIX compliant features 2020-07-22 11:46:58 -04:00
Michael Czigler
920b95c042 squash commit, remove non-POSIX features in checkUtils 2020-07-21 09:07:44 -04:00
arzzen
e31fc931c8 add git log options to myDailyStats 2020-07-10 18:13:01 +02:00
arzzen
1eb8c53f09 ability to use options for git log command 2020-07-09 09:21:25 +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
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
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
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
24ae67ae57 update commitsByWeekday sorting
Fix inconsistent sum sorting in by-weekday, #91
2020-02-14 09:34:46 +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
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
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
75c8bdc0de Merge pull request #80 from ProcrastinatorCp/gh-70
Support commits by co-authors
2019-10-13 17:41:05 +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
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
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
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