generated from simonw/click-app-template-repository
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
https://pinafore.social/statuses/109671158910886602 reports problems loading the history for data/stats.json
in https://github.com/Ambrosiani/GLAM_stats
Sure enough, I tried this:
cd /tmp
git clone https://github.com/Ambrosiani/GLAM_stats
cd GLAM_stats
git-history file stats.db data/stats.json --id name --branch master
Output:
[####################################] 176/176 100%% GLAM_stats %
But:
% sqlite-utils dump stats.db
BEGIN TRANSACTION;
CREATE TABLE [namespaces] (
[id] INTEGER PRIMARY KEY,
[name] TEXT
);
INSERT INTO "namespaces" VALUES(1,'item');
CREATE UNIQUE INDEX [idx_namespaces_name]
ON [namespaces] ([name]);
COMMIT;
So it didn't actually work.
On a bit of debugging it turns out this code was at fault:
git-history/git_history/cli.py
Lines 26 to 34 in 8d1d6b7
for commit in commits: | |
if progress_bar: | |
progress_bar.update(1) | |
try: | |
blob = [b for b in commit.tree.blobs if b.name == relative_path][0] | |
yield commit.committed_datetime, commit.hexsha, blob.data_stream.read() | |
except IndexError: | |
# This commit doesn't have a copy of the requested file | |
pass |
The "This commit doesn't have a copy of the requested file" branch was being hit for every commit.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working