-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
60 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
linux | ||
bpf | ||
mails/bpf | ||
linux/commits.csv |
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
linux: | ||
git clone https://github.com/torvalds/linux | ||
|
||
bpf: | ||
git clone --mirror http://lore.kernel.org/bpf/0 bpf/git/0.git | ||
cd bpf/git/0.git && ../../../dump.sh | ||
mails/bpf: | ||
cd mails && git clone --mirror http://lore.kernel.org/bpf/0 bpf/git/0.git | ||
|
||
linux/commits.csv: | ||
cd linux && git log --pretty=format:'"%H","%an","%ae","%ad","%cn","%ce","%cd","%T","%P","%B"' --date=iso > commits.csv |
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,36 @@ | ||
import csv | ||
|
||
def process_commits_csv(file_path): | ||
# Open the CSV file for reading | ||
with open(file_path, mode='r', encoding='utf-8') as file: | ||
# Use csv.reader to parse the CSV file | ||
csv_reader = csv.reader(file) | ||
|
||
# Define headers for better understanding of what each column represents | ||
headers = ["commit_hash", "author_name", "author_email", "author_date", | ||
"committer_name", "committer_email", "committer_date", | ||
"tree_hash", "parent_hashes", "full_commit_message"] | ||
|
||
# Initialize an empty list to store processed commits | ||
commits = [] | ||
|
||
# Process each row in the CSV | ||
for row in csv_reader: | ||
# Ensure that the row is correctly formatted | ||
if len(row) == len(headers): | ||
commit_data = dict(zip(headers, row)) | ||
commits.append(commit_data) | ||
|
||
return commits | ||
|
||
if __name__ == "__main__": | ||
# Path to your CSV file | ||
file_path = 'commits.csv' | ||
|
||
# Process the CSV file | ||
commits = process_commits_csv(file_path) | ||
|
||
# Print out a summary of the commits | ||
# print_commit_summary(commits) | ||
|
||
# You can further process `commits` list as needed (e.g., filter by author, date, etc.) |
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 @@ | ||
# The data will be generated here. |
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,2 @@ | ||
# The first mail is Wed, 13 Feb 2019 16:56:04 -0500 | ||
git rev-list --all --objects | grep 'm$' | awk '{print $1}' | wc -l |
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,15 @@ | ||
#!/bin/bash | ||
|
||
# Check if the number of commits (n) is passed as an argument | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <number_of_commits>" | ||
exit 1 | ||
fi | ||
|
||
# Store the argument in a variable | ||
n=$1 | ||
|
||
# Run git log with the specified number of commits and format the output into a CSV file | ||
git log --pretty=format:'"%H","%an","%ae","%ad","%cn","%ce","%cd","%T","%P","%B","%N"' -n "$n" --date=iso > commits.csv | ||
|
||
echo "Dumped $n commits to commits.csv" |
File renamed without changes.
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 @@ | ||
git log --grep=bpf --oneline | wc -l |