Why Nostr? What is Njump?
2024-07-03 00:52:13

npub1wa…76rau on Nostr: commit 1df855941561e9b3b43a5cb65b884748b06edd7e Author: @RandyMcMillan ...

commit 1df855941561e9b3b43a5cb65b884748b06edd7e
Author: @RandyMcMillan <[email protected]>
Date: Wed Feb 21 13:38:20 2024 -0500

src/main.rs:--reflog:padded commit hashes

diff --git a/src/main.rs b/src/main.rs
index 145d54771..4a53b6aaa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -107,6 +107,8 @@ fn command_example() {
println!("{}", post);
}

+
+//reflog_simple
pub fn reflog_simple() -> Result<(), git2::Error> {

let repo = match Repository::open(".") {
@@ -123,67 +125,9 @@ revwalk.set_sorting(git2::Sort::TIME)?;
for rev in revwalk {
let commit = repo.find_commit(rev?)?;
let message = commit.summary_bytes().unwrap_or_else(|| commit.message_bytes());
- println!("{}\t{}", commit.id(), String::from_utf8_lossy(message));
+ println!("{:0>64}\n{}", commit.id(), String::from_utf8_lossy(message));
}

-
-//let mut revwalk = match Revwalk::new(&repo) {
-// Ok(revwalk) => revwalk,
-// Err(e) => panic!("Error creating revwalk: {}", e),
-//};
-
-// Start at HEAD and show the last 10 commits
-//revwalk.set_head(repo.find_reference("HEAD")?);
-//revwalk.set_limit(10);
-
-// Walk the commit history and process each commit
-//for commit in revwalk {
-// let commit = commit?;
-// // Do something with the commit
-//}
-
-//process::exit(0);
-
-
-// // Collect and parse arguments
-// let args: Vec<String> = env::args().collect();
-// let mut opts = Options::new();
-// opts.optopt("r", "ref", "Specify the Git reference (default: HEAD)", "REF");
-// opts.optopt("n", "number", "Specify the maximum number of commits to show (default: 10)", "NUMBER");
-//
-// let matches = opts.parse(&args[1..]).unwrap();
-//
-// // Extract and validate arguments
-// let ref_name = matches.opt_str("r").unwrap_or("HEAD".to_string());
-// let num_commits = matches.opt_str("n")
-// .unwrap_or("10".to_string())
-// .parse::<i32>();
-// //.parse::<i32>()?;
-//
-// println!("num_commits={:?}", num_commits);
-// //if num_commits <= "0" {
-// // //return Err(git2::Error::from_str("0",git2::ErrorClass::Invalid, "Number of commits must be positive"));
-// // return Err(git2::Error::from_str("0"));
-// //}
-//
-//// // Open the Git repository
-//// let repo = Repository::open_bare(".")?;
-////
-//// // Create a Revwalk object
-//// let mut revwalk = Revwalk::new(&repo)?;
-////
-//// // Set starting commit
-//// revwalk.set_head(repo.find_reference_name(&ref_name)?);
-////
-//// // Limit the number of commits
-//// revwalk.set_limit(num_commits as u32);
-//
-// // Walk the commit history and print commit IDs
-//// for commit in revwalk {
-//// let commit = commit?;
-//// println!("{}", commit.id());
-//// }
-
Ok(())
}
Author Public Key
npub1wap99hlkt02m577rt83qadngv34uvfyfrh7672h5uhf05mc77susv76rau