-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mv/log-since-as-filter'
"git log --since=X" will stop traversal upon seeing a commit that is older than X, but there may be commits behind it that is younger than X when the commit was created with a faulty clock. A new option is added to keep digging without stopping, and instead filter out commits with timestamp older than X. * mv/log-since-as-filter: log: "--since-as-filter" option is a non-terminating "--since" variant
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
|
||
test_description='git log with filter options limiting the output' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success 'setup test' ' | ||
git init && | ||
echo a >file && | ||
git add file && | ||
GIT_COMMITTER_DATE="2021-02-01 00:00" git commit -m init && | ||
echo a >>file && | ||
git add file && | ||
GIT_COMMITTER_DATE="2022-02-01 00:00" git commit -m first && | ||
echo a >>file && | ||
git add file && | ||
GIT_COMMITTER_DATE="2021-03-01 00:00" git commit -m second && | ||
echo a >>file && | ||
git add file && | ||
GIT_COMMITTER_DATE="2022-03-01 00:00" git commit -m third | ||
' | ||
|
||
test_expect_success 'git log --since-as-filter=...' ' | ||
git log --since-as-filter="2022-01-01" --format=%s >actual && | ||
cat >expect <<-\EOF && | ||
third | ||
first | ||
EOF | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'git log --children --since-as-filter=...' ' | ||
git log --children --since-as-filter="2022-01-01" --format=%s >actual && | ||
cat >expect <<-\EOF && | ||
third | ||
first | ||
EOF | ||
test_cmp expect actual | ||
' | ||
|
||
test_done |