Skip to content

Commit

Permalink
Changed default setting to -n=0
Browse files Browse the repository at this point in the history
The default setting has been changed to 0 for the parameter n. That means that unless explicitely stated differently, the report information for all commits will be shown.
  • Loading branch information
Korne127 committed Jun 2, 2021
1 parent 2d4698e commit 1b2abaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
10 changes: 2 additions & 8 deletions command/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Options:
Commit Limiting:
-n int=1 Limit output, 0 is no limits, defaults to 1 when no limiting flags otherwise defaults to 0
-n int=1 Limit output, 0 is no limit, defaults to 0
-from-date=yyyy-mm-dd Show commits starting from this date
-to-date=yyyy-mm-dd Show commits thru the end of this date
-author="" Show commits which contain author substring
Expand Down Expand Up @@ -86,7 +86,7 @@ func (c ReportCmd) Run(args []string) int {
cmdFlags.BoolVar(&terminalOff, "terminal-off", false, "")
cmdFlags.BoolVar(&appOff, "app-off", false, "")
cmdFlags.StringVar(&format, "format", "commits", "")
cmdFlags.IntVar(&limit, "n", -1, "")
cmdFlags.IntVar(&limit, "n", 0, "")
cmdFlags.BoolVar(&fullMessage, "full-message", false, "")
cmdFlags.StringVar(&fromDate, "from-date", "", "")
cmdFlags.StringVar(&toDate, "to-date", "", "")
Expand Down Expand Up @@ -191,12 +191,6 @@ func (c ReportCmd) Run(args []string) int {
return 1
}

// if project format and not set differently, we want all commits for the project
if format == "project" && limit == -1 {
// limit of 0 symbolises no limit
limit = 0
}

limiter, err := scm.NewCommitLimiter(
limit, fromDate, toDate, author, message,
today, yesterday, thisWeek, lastWeek,
Expand Down
10 changes: 0 additions & 10 deletions scm/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,6 @@ func NewCommitLimiter(

hasAuthor := author != ""
hasMessage := message != ""

// If no limit has manually been set, 0 or 1 is chosen depending on other settings
if max == -1 {
if !(dateRange.IsSet() || hasAuthor || hasMessage) {
max = 0
} else {
max = 1
}
}

hasMax := max > 0

return CommitLimiter{
Expand Down

0 comments on commit 1b2abaa

Please sign in to comment.