Skip to content

Commit c440e07

Browse files
committed
add gemfile and update PRD
1 parent dfe7dee commit c440e07

3 files changed

Lines changed: 181 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Product Requirements Document: Date-Based Search in GitContentSearch
2+
3+
## 1. Introduction
4+
5+
This document outlines the requirements for adding date-based search functionality to GitContentSearch. Currently, the tool allows searching for a string within a file's history between two specified commit SHAs. This enhancement will enable users to search between two dates, making it more intuitive and user-friendly.
6+
7+
## 2. How It Works
8+
9+
The date-based search functionality will be implemented as follows:
10+
11+
1. **Date to Commit Mapping:**
12+
* GitContentSearch will use the `git log` command to identify commits within the specified date range.
13+
* The command `git log --since="start-date" --until="end-date" --pretty=%H` will be executed to retrieve a list of commit SHAs.
14+
* `--since`: Specifies the start date.
15+
* `--until`: Specifies the end date.
16+
* `--pretty=%H`: Formats the output to only include the commit SHA.
17+
* Supported date formats include `YYYY-MM-DD` (e.g., `2023-01-01`) and relative dates (e.g., `2.weeks.ago`).
18+
* The earliest commit after `--since` will be considered the "earliest commit".
19+
* The latest commit before `--until` will be considered the "latest commit".
20+
21+
2. **Binary Search:** Once the earliest and latest commits are determined, the existing binary search algorithm will be used to find the commit where the search string was introduced.
22+
23+
## 3. User Interface (UI) Changes
24+
25+
* **Input Fields:**
26+
* Replace the existing "Earliest Commit" and "Latest Commit" input fields with "Start Date" and "End Date" fields.
27+
* **Date Picker:**
28+
* Utilize a date picker widget (e.g., from AvaloniaUI or a similar cross-platform framework) to provide a user-friendly date selection experience.
29+
* **Validation:**
30+
* Implement input validation to ensure:
31+
* The start date is before the end date.
32+
* Both dates are in a valid format (e.g., `YYYY-MM-DD`).
33+
* Dates are not in the future.
34+
35+
## 4. Command-Line Interface (CLI) Changes
36+
37+
* **Backward Compatibility:**
38+
* Retain the existing `--earliest-commit` and `--latest-commit` options for backward compatibility.
39+
* **New Date Options:**
40+
* Introduce new optional arguments:
41+
* `--start-date`: Specifies the start date for the search.
42+
* `--end-date`: Specifies the end date for the search.
43+
* **Example Command:**
44+
```bash
45+
GitContentSearch.exe "path/to/your/file.xlsx" "SearchString" --start-date="2023-01-01" --end-date="2023-12-31" --working-directory="/your/git/repo" --log-directory="/your/log/directory" --follow
46+
```
47+
* **Option Priority:**
48+
* If both commit-based (`--earliest-commit`, `--latest-commit`) and date-based (`--start-date`, `--end-date`) options are provided, prioritize commit-based options. Log a warning message indicating this prioritization.
49+
50+
## 5. Edge Case Handling
51+
52+
* **No Commits in Range:**
53+
* If no commits are found within the specified date range, display a clear and informative error message to the user. Example: "No commits found between 2023-01-01 and 2023-12-31".
54+
* **Time Zones:**
55+
* Consistently use UTC (Git's default behavior) for date and time comparisons.
56+
* Include a note in both the UI and CLI documentation clarifying the time zone handling (UTC).
57+
* **Invalid Dates:**
58+
* Implement robust date validation to prevent errors. This includes:
59+
* Rejecting dates in the future.
60+
* Ensuring the date format is correct (e.g., `YYYY-MM-DD`).
61+
* Handling invalid date inputs gracefully (e.g., February 30th).

docs/Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 4.3" # Latest stable
4+
gem "jekyll-theme-chirpy"
5+
gem "jekyll-seo-tag"
6+
gem "jekyll-feed"
7+
gem "jekyll-sitemap"
8+
gem "jekyll-remote-theme"

docs/Gemfile.lock

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.8.7)
5+
public_suffix (>= 2.0.2, < 7.0)
6+
base64 (0.2.0)
7+
bigdecimal (3.1.9)
8+
colorator (1.1.0)
9+
concurrent-ruby (1.3.5)
10+
csv (3.3.2)
11+
em-websocket (0.5.3)
12+
eventmachine (>= 0.12.9)
13+
http_parser.rb (~> 0)
14+
eventmachine (1.2.7)
15+
ffi (1.17.1-x64-mingw-ucrt)
16+
forwardable-extended (2.6.0)
17+
google-protobuf (4.30.0-x64-mingw-ucrt)
18+
bigdecimal
19+
rake (>= 13)
20+
http_parser.rb (0.8.0)
21+
i18n (1.14.7)
22+
concurrent-ruby (~> 1.0)
23+
jekyll (4.4.1)
24+
addressable (~> 2.4)
25+
base64 (~> 0.2)
26+
colorator (~> 1.0)
27+
csv (~> 3.0)
28+
em-websocket (~> 0.5)
29+
i18n (~> 1.0)
30+
jekyll-sass-converter (>= 2.0, < 4.0)
31+
jekyll-watch (~> 2.0)
32+
json (~> 2.6)
33+
kramdown (~> 2.3, >= 2.3.1)
34+
kramdown-parser-gfm (~> 1.0)
35+
liquid (~> 4.0)
36+
mercenary (~> 0.3, >= 0.3.6)
37+
pathutil (~> 0.9)
38+
rouge (>= 3.0, < 5.0)
39+
safe_yaml (~> 1.0)
40+
terminal-table (>= 1.8, < 4.0)
41+
webrick (~> 1.7)
42+
jekyll-archives (2.3.0)
43+
jekyll (>= 3.6, < 5.0)
44+
jekyll-feed (0.17.0)
45+
jekyll (>= 3.7, < 5.0)
46+
jekyll-include-cache (0.2.1)
47+
jekyll (>= 3.7, < 5.0)
48+
jekyll-paginate (1.1.0)
49+
jekyll-redirect-from (0.16.0)
50+
jekyll (>= 3.3, < 5.0)
51+
jekyll-remote-theme (0.4.3)
52+
addressable (~> 2.0)
53+
jekyll (>= 3.5, < 5.0)
54+
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
55+
rubyzip (>= 1.3.0, < 3.0)
56+
jekyll-sass-converter (3.0.0)
57+
sass-embedded (~> 1.54)
58+
jekyll-seo-tag (2.8.0)
59+
jekyll (>= 3.8, < 5.0)
60+
jekyll-sitemap (1.4.0)
61+
jekyll (>= 3.7, < 5.0)
62+
jekyll-theme-chirpy (7.2.4)
63+
jekyll (~> 4.3)
64+
jekyll-archives (~> 2.2)
65+
jekyll-include-cache (~> 0.2)
66+
jekyll-paginate (~> 1.1)
67+
jekyll-redirect-from (~> 0.16)
68+
jekyll-seo-tag (~> 2.8)
69+
jekyll-sitemap (~> 1.4)
70+
jekyll-watch (2.2.1)
71+
listen (~> 3.0)
72+
json (2.10.2)
73+
kramdown (2.5.1)
74+
rexml (>= 3.3.9)
75+
kramdown-parser-gfm (1.1.0)
76+
kramdown (~> 2.0)
77+
liquid (4.0.4)
78+
listen (3.9.0)
79+
rb-fsevent (~> 0.10, >= 0.10.3)
80+
rb-inotify (~> 0.9, >= 0.9.10)
81+
mercenary (0.4.0)
82+
pathutil (0.16.2)
83+
forwardable-extended (~> 2.6)
84+
public_suffix (6.0.1)
85+
rake (13.2.1)
86+
rb-fsevent (0.11.2)
87+
rb-inotify (0.11.1)
88+
ffi (~> 1.0)
89+
rexml (3.4.1)
90+
rouge (4.5.1)
91+
rubyzip (2.4.1)
92+
safe_yaml (1.0.5)
93+
sass-embedded (1.85.1-x64-mingw-ucrt)
94+
google-protobuf (~> 4.29)
95+
terminal-table (3.0.2)
96+
unicode-display_width (>= 1.1.1, < 3)
97+
unicode-display_width (2.6.0)
98+
webrick (1.9.1)
99+
100+
PLATFORMS
101+
x64-mingw-ucrt
102+
103+
DEPENDENCIES
104+
jekyll (~> 4.3)
105+
jekyll-feed
106+
jekyll-remote-theme
107+
jekyll-seo-tag
108+
jekyll-sitemap
109+
jekyll-theme-chirpy
110+
111+
BUNDLED WITH
112+
2.6.5

0 commit comments

Comments
 (0)