Lab 2

Adding a Recent Changes Filter:

For Lab 2, I contributed to my teammate Steven’s project Repo_Code_packager. The goal was to add a new feature so that the tool can package only the files modified in the last 7 days. This was done by implementing a –r…


This content originally appeared on DEV Community and was authored by kkrishnan10

Adding a Recent Changes Filter:

For Lab 2, I contributed to my teammate Steven's project Repo_Code_packager. The goal was to add a new feature so that the tool can package only the files modified in the last 7 days. This was done by implementing a --recent (or -r) command-line flag.

Step 1: Filing an Issue
I first checked the repo’s Issues to make sure no one had already started this feature. Since I didn’t find it, I filed a new issue: Add support for --recent flag.
In the issue, I explained:
-> The new flag I wanted to add (--recent / -r)
-> The expected behavior (include only files modified in the last 7 days)
-> Example usage with commands and expected output
-> This gave the maintainer enough detail to understand the feature before I started coding.

Step 2: Fork, Clone, Branch
I forked the repo into my GitHub account https://github.com/kkrishnan10/Repo_Code_packager, then cloned it locally:
git clone https://github.com/kkrishnan10/Repo_Code_packager.git
cd Repo_Code_packager
git checkout -b feature-recent-files
All my changes were committed on the new branch feature-recent-files.

Step 3: Implementation
I made three main changes in src/main.py:
-> Added a timestamp check
-> Updated the file discovery logic
The program now filters files so only those modified in the last 7 days are included when --recent or -r is used.
-> Added a new “Recent Changes” section in the output

Step 4: Testing
I tested my changes locally:
python src/main.py . --recent

python src/main.py . -r -o recent-output.txt

Expected result: Only files modified in the last 7 days appeared in both the console and the saved output file.
Actual result: Worked as expected.

Step 5: Pull Request
Finally, I pushed my branch and opened a Pull Request.
My PR description included:
-> Summary of the feature
-> Implementation details
-> Example usage with code blocks

Links:
Repo: https://github.com/Jongwan93/Repo_Code_packager
Issue: https://github.com/Jongwan93/Repo_Code_packager/pull/4
Pull Request: https://github.com/Jongwan93/Repo_Code_packager/pull/4


This content originally appeared on DEV Community and was authored by kkrishnan10


Print Share Comment Cite Upload Translate Updates
APA

kkrishnan10 | Sciencx (2025-09-18T03:36:06+00:00) Lab 2. Retrieved from https://www.scien.cx/2025/09/18/lab-2/

MLA
" » Lab 2." kkrishnan10 | Sciencx - Thursday September 18, 2025, https://www.scien.cx/2025/09/18/lab-2/
HARVARD
kkrishnan10 | Sciencx Thursday September 18, 2025 » Lab 2., viewed ,<https://www.scien.cx/2025/09/18/lab-2/>
VANCOUVER
kkrishnan10 | Sciencx - » Lab 2. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/18/lab-2/
CHICAGO
" » Lab 2." kkrishnan10 | Sciencx - Accessed . https://www.scien.cx/2025/09/18/lab-2/
IEEE
" » Lab 2." kkrishnan10 | Sciencx [Online]. Available: https://www.scien.cx/2025/09/18/lab-2/. [Accessed: ]
rf:citation
» Lab 2 | kkrishnan10 | Sciencx | https://www.scien.cx/2025/09/18/lab-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.