Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count lines changed for current file #946

Closed
wants to merge 1 commit into from

Conversation

gandarez
Copy link
Member

@gandarez gandarez commented Oct 3, 2023

This PR adds a feature to count lines changed for a specific file if rev control is Git.

Steps to tests:

  1. Build wakatime-cli with make
  2. Change any file inside a git repository
  3. Call ./build/wakatime-cli* --entity "/path/to/changed_file" --log-to-stdout --verbose
  4. It should print an array of heartbeats and the first element must contain lines_added and lines_removed fields
  5. It should sync activity

Closes #609

@gandarez gandarez self-assigned this Oct 3, 2023
@gandarez gandarez force-pushed the feature/git-count-lines-changed branch from c5fed1c to 289da63 Compare October 3, 2023 18:20
@gandarez gandarez force-pushed the feature/git-count-lines-changed branch 3 times, most recently from 83fa606 to b3115c7 Compare October 24, 2023 17:26
@gandarez gandarez force-pushed the feature/git-count-lines-changed branch from b3115c7 to f6cb5d8 Compare October 24, 2023 18:15
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #946 (83fa606) into develop (36f6372) will increase coverage by 0.06%.
The diff coverage is 73.91%.

❗ Current head 83fa606 differs from pull request most recent head f6cb5d8. Consider uploading reports for the commit f6cb5d8 to get more accurate results

@@             Coverage Diff             @@
##           develop     #946      +/-   ##
===========================================
+ Coverage    62.36%   62.43%   +0.06%     
===========================================
  Files          372      373       +1     
  Lines        15660    15751      +91     
===========================================
+ Hits          9767     9834      +67     
- Misses        5366     5386      +20     
- Partials       527      531       +4     
Flag Coverage Δ
unittests 62.43% <73.91%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
cmd/params/params.go 85.94% <100.00%> (ø)
pkg/heartbeat/heartbeat.go 86.95% <ø> (ø)
pkg/project/project.go 88.50% <100.00%> (+0.31%) ⬆️
pkg/git/git.go 75.00% <75.00%> (ø)
pkg/project/git.go 61.66% <65.90%> (+0.08%) ⬆️

@alanhamlett
Copy link
Member

Closing in favor of #1023.

@alanhamlett alanhamlett closed this Feb 7, 2024
@alanhamlett alanhamlett deleted the feature/git-count-lines-changed branch February 7, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request - Track Lines of Code
2 participants