Everyone talking about "biff" should be aware that it's actually "bttf" like "back to the future"
Bttf is a command line datetime Swiss army knife
71–80 of 104 posts
Re: Bttf is a command line datetime Swiss army knife
#72Everyone talking about "biff" should be aware that it's actually "bttf" like "back to the future"
Re: Bttf is a command line datetime Swiss army knife
#73Respect for programming this. I did some date/time calculations a few years ago using Perl and it was full of corner cases and trouble. Did I enjoy it? I enjoyed seeing it work. Hopefully with the right answers! This tool looks great.
Re: Bttf is a command line datetime Swiss army knife
#74No, Biff informs the system whether you want to be notified when mail arrives during the current terminal session.
Re: Bttf is a command line datetime Swiss army knife
#75Respect for programming this. I did some date/time calculations a few years ago using Perl and it was full of corner cases and trouble. Did I enjoy it? I enjoyed seeing it work. Hopefully with the right answers! This tool looks great.
Perl's DateTime module was pretty solid, IIRC. One of the things I miss about using Perl.
Re: Bttf is a command line datetime Swiss army knife
#76I'm the author of Bttf. I just wanted to share a really cool example of something that Bttf can do that I _think_ is kinda hard to do otherwise. (And also, I want to make an assertion about it and I hope this will lead to me being wrong and learning something new.) The use case is: "I want to see a list of all files in a repository, sorted in ascending order of when it was most recently changed according to source co…
In terms of machine time? I'd guess so, but I'd also guess calling it for each of `git ls-files` is not the fastest way to get the most recent commit of all the files in a typical scenario (large repo, recent time of interest, most files not changed that recently). And especially if you're okay assuming the most recent commit by parentage is the one you want (even if parentage doesn't match chronological order); then filtering with `git log --name-only --since` (no path argument) seems better. A `git log` post-processing script could also stop early if it's seen a commit for each the files of interest (again, assuming you don't want to return a later date that is attached to an ancestor commit).
Anyway, cool tool, and it's rare that I would actually care about the machine efficiency of this pipeline enough to bother with the approach I just described.
Re: Bttf is a command line datetime Swiss army knife
#77I remember when biff was what we ran in a CSH to be informed of new email. I don’t remember if this was a local UCB tool or if it was part of BSD.
Re: Bttf is a command line datetime Swiss army knife
#78I'm the author of Bttf. I just wanted to share a really cool example of something that Bttf can do that I _think_ is kinda hard to do otherwise. (And also, I want to make an assertion about it and I hope this will lead to me being wrong and learning something new.) The use case is: "I want to see a list of all files in a repository, sorted in ascending order of when it was most recently changed according to source co…
Re: Bttf is a command line datetime Swiss army knife
#79I'm the author of Bttf. I just wanted to share a really cool example of something that Bttf can do that I _think_ is kinda hard to do otherwise. (And also, I want to make an assertion about it and I hope this will lead to me being wrong and learning something new.) The use case is: "I want to see a list of all files in a repository, sorted in ascending order of when it was most recently changed according to source co…
Instead of running `git log -n1` on every file, I think you can walk through the commits backwards, skipping any files that have been seen. Something like this (these two commands could be followed by bttf commands):
git log --pretty=format:"DATE:%aI" --name-only |
awk '/^DATE:/ {date=substr($0, 6); next} $0!="" && !seen[$0]++ {print date, $0}'
This seems to run much faster. The only problem is it'll include files that have been renamed or removed. I got an AI to fix that too, but it starts getting awkward (still fast though!): git ls-files |
awk '
# Read all existing files from git ls-files into an array
NR==FNR { lsfiles[$0]; next }
# Process the git log stream
/^DATE:/ { date=substr($0, 6); next }
$0!="" && ($0 in lsfiles) && !seen[$0]++ { print date, $0 }
' - Re: Bttf is a command line datetime Swiss army knife
#80I'm the author of Bttf. I just wanted to share a really cool example of something that Bttf can do that I _think_ is kinda hard to do otherwise. (And also, I want to make an assertion about it and I hope this will lead to me being wrong and learning something new.) The use case is: "I want to see a list of all files in a repository, sorted in ascending order of when it was most recently changed according to source co…