* [9front] equivalent of git log
@ 2024-12-23 4:29 ron minnich
2024-12-23 4:49 ` ori
2024-12-23 10:00 ` hiro
0 siblings, 2 replies; 8+ messages in thread
From: ron minnich @ 2024-12-23 4:29 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
I'm trying and failing to get what I'm used to getting with git log.
on standard git, git log is essentially a diff between HEAD and HEAD^, but
i don't know how to express that.
I also am used to being able to do stuff like
git log main..HEAD
so I tried git log front:head
but that does not really give me what I"m used to, any pointers on what I"m
missing?
[-- Attachment #2: Type: text/html, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-23 4:29 [9front] equivalent of git log ron minnich
@ 2024-12-23 4:49 ` ori
2024-12-23 10:00 ` hiro
1 sibling, 0 replies; 8+ messages in thread
From: ori @ 2024-12-23 4:49 UTC (permalink / raw)
To: 9front
Quoth ron minnich <rminnich@gmail.com>:
> I'm trying and failing to get what I'm used to getting with git log.
>
> on standard git, git log is essentially a diff between HEAD and HEAD^, but
> i don't know how to express that.
I'm not sure what you mean here; by default, it does
the same thing -- for example, on the drawterm repo,
torvalds git gives this output:
$ git log
commit d7620e8d528a87a3d6cf7285a839d52d4f705771
Author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
Date: Fri Oct 4 01:22:35 2024 +0000
missed tas.c opportunity
commit ea04c68f2bd28d6c75d21688a07ac6b817192b67
Author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
Date: Thu Oct 3 01:13:53 2024 +0000
remove non-portable posix stuff, use C compiler builtins instead (thanks be0ba and thedæmon for testing)
commit 789b8fe40e156ad0252230b13dd4ada96f3eed8b
Author: aap <aap@papnet.eu>
Date: Mon Sep 9 13:08:35 2024 +0000
x11: only turn ASCII chars into control chars when ctrl is down
while our git gives:
% git/log
Hash: d7620e8d528a87a3d6cf7285a839d52d4f705771
Author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
Date: Thu Oct 3 21:22:35 -0400 2024
missed tas.c opportunity
Hash: ea04c68f2bd28d6c75d21688a07ac6b817192b67
Author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
Date: Wed Oct 2 21:13:53 -0400 2024
remove non-portable posix stuff, use C compiler builtins instead (thanks be0ba and thedæmon for testing)
Hash: 789b8fe40e156ad0252230b13dd4ada96f3eed8b
Author: aap <aap@papnet.eu>
Date: Mon Sep 9 09:08:35 -0400 2024
x11: only turn ASCII chars into control chars when ctrl is down
>
> I also am used to being able to do stuff like
> git log main..HEAD
> so I tried git log front:head
> but that does not really give me what I"m used to, any pointers on what I"m
> missing?
>
we don't overload args the way torvalds git does; the arguments
are always the files that you're filtering for changes on.
you're looking for '-e'; also, due to a conflict with rc concat,
we use '~' for previous commits, not '^'; full syntax is docuemnted
under git/query, and patches welcome for 'commit~N' syntax.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-23 4:29 [9front] equivalent of git log ron minnich
2024-12-23 4:49 ` ori
@ 2024-12-23 10:00 ` hiro
2024-12-23 14:46 ` ron minnich
1 sibling, 1 reply; 8+ messages in thread
From: hiro @ 2024-12-23 10:00 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
> on standard git, git log is essentially a diff between HEAD and HEAD^, but
> i don't know how to express that.
>
you mean s/log/show/ probably?
[-- Attachment #2: Type: text/html, Size: 442 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-23 10:00 ` hiro
@ 2024-12-23 14:46 ` ron minnich
2024-12-23 15:54 ` ori
0 siblings, 1 reply; 8+ messages in thread
From: ron minnich @ 2024-12-23 14:46 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
Yes, you’re right. That said, how do I get show?
On Mon, Dec 23, 2024 at 03:03 hiro <23hiro@gmail.com> wrote:
>
> on standard git, git log is essentially a diff between HEAD and HEAD^, but
>> i don't know how to express that.
>>
>
> you mean s/log/show/ probably?
>
>
[-- Attachment #2: Type: text/html, Size: 825 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-23 14:46 ` ron minnich
@ 2024-12-23 15:54 ` ori
2024-12-23 18:20 ` ron minnich
0 siblings, 1 reply; 8+ messages in thread
From: ori @ 2024-12-23 15:54 UTC (permalink / raw)
To: 9front
Quoth ron minnich <rminnich@gmail.com>:
> Yes, you’re right. That said, how do I get show?
>
> On Mon, Dec 23, 2024 at 03:03 hiro <23hiro@gmail.com> wrote:
>
> >
> > on standard git, git log is essentially a diff between HEAD and HEAD^, but
> >> i don't know how to express that.
> >>
> >
> > you mean s/log/show/ probably?
> >
> >
>
git/export
note, while it's not hard to do (take a peek inside git/diff)
there's no great comand yet for diffing between any two
arbitrary commits; maybe we patch getflags to allow repeated
applications of flags, and then:
git/diff -c $first -c $second files..
I'm open to other ideas, including doing nothing; you've got
git/fs and diff, what more do you need?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-23 15:54 ` ori
@ 2024-12-23 18:20 ` ron minnich
2024-12-24 4:02 ` ori
0 siblings, 1 reply; 8+ messages in thread
From: ron minnich @ 2024-12-23 18:20 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]
I think it pays to have a few of these convenience bits done. I use dit
diff commit..commit and git log commit..commit all the time.
I am of the opinion that the 9front git is for the most part a real upgrade
from the original, but I do miss some of the conveniences.
in any event, git/diff -c ref -c ref is not bad as a start!
On Mon, Dec 23, 2024 at 8:19 AM <ori@eigenstate.org> wrote:
> Quoth ron minnich <rminnich@gmail.com>:
> > Yes, you’re right. That said, how do I get show?
> >
> > On Mon, Dec 23, 2024 at 03:03 hiro <23hiro@gmail.com> wrote:
> >
> > >
> > > on standard git, git log is essentially a diff between HEAD and HEAD^,
> but
> > >> i don't know how to express that.
> > >>
> > >
> > > you mean s/log/show/ probably?
> > >
> > >
> >
>
> git/export
>
> note, while it's not hard to do (take a peek inside git/diff)
> there's no great comand yet for diffing between any two
> arbitrary commits; maybe we patch getflags to allow repeated
> applications of flags, and then:
>
> git/diff -c $first -c $second files..
>
> I'm open to other ideas, including doing nothing; you've got
> git/fs and diff, what more do you need?
>
>
[-- Attachment #2: Type: text/html, Size: 1850 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-23 18:20 ` ron minnich
@ 2024-12-24 4:02 ` ori
2024-12-24 14:37 ` hiro
0 siblings, 1 reply; 8+ messages in thread
From: ori @ 2024-12-24 4:02 UTC (permalink / raw)
To: 9front
Quoth ron minnich <rminnich@gmail.com>:
> I think it pays to have a few of these convenience bits done. I use dit
> diff commit..commit and git log commit..commit all the time.
>
> I am of the opinion that the 9front git is for the most part a real upgrade
> from the original, but I do miss some of the conveniences.
>
> in any event, git/diff -c ref -c ref is not bad as a start!
I don't like it much, but here's a first attempt; it now takes
an expression for -c and diffs between the first and last result
of the query, as in:
git/diff -c HEAD~~~..front
maybe someone else can come up with better.
diff 248634879a9b78f08ddaeda9c7a50ba413fd4804 uncommitted
--- a/sys/src/cmd/git/diff
+++ b/sys/src/cmd/git/diff
@@ -4,7 +4,7 @@
gitup
-flagfmt='c:commit branch, s:summarize, u:uncommitted'; args='[file ...]'
+flagfmt='c:commit expr, s:summarize, u:uncommitted'; args='[file ...]'
eval `''{aux/getflags $*} || exec aux/usage
if(~ $#commit 0){
@@ -19,7 +19,6 @@
if(! ~ $#* 0)
files=`{cleanname -d $gitrel $*}
-branch=`{git/query -p $commit}
if(~ $summarize 1 || ~ $uncommitted 1){
git/walk -r$gitrel -f$filt $cparam $files
exit
@@ -26,13 +25,34 @@
}
showed=()
-mntgen /mnt/scratch
-bind $branch/tree/ /mnt/scratch/a
-bind . /mnt/scratch/b
bparam=()
-if(~ $#commit 1)
+if(~ $#commit 1){
bparam=(-b $commit)
-for(f in `$nl{git/walk $bparam -c -f$filt $cparam $files}){
+mntgen /mnt/scratch
+hashes=`{git/query $commit}
+branch=`{git/query -p $hashes}
+fn changed {
+ git/walk $bparam -c -f$filt $cparam $files
+}
+if(~ $#branch 0 || ! ~ $#branch $#hashes){
+ >[1=2] echo could not resolve branches for $commit
+ exit nobranch
+}
+if not if(~ $#branch 1){
+ bind $branch/tree/ /mnt/scratch/a
+ bind . /mnt/scratch/b
+}
+if not {
+ fn changed {
+ git/query -c $hashes(1)..$hashes($#hashes) | sed 's/^..//'
+ }
+ bind $branch(1)^/tree/ /mnt/scratch/a
+ bind $branch($#branch)^/tree /mnt/scratch/b
+}
+
+echo $changed
+for(f in `$nl{changed}){
+echo $f
if(~ $#showed 0){
echo diff `{git/query $commit} uncommitted
showed=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [9front] equivalent of git log
2024-12-24 4:02 ` ori
@ 2024-12-24 14:37 ` hiro
0 siblings, 0 replies; 8+ messages in thread
From: hiro @ 2024-12-24 14:37 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]
is it possible to somehow make it 2 file arguments
/mnt/gitfs/HEAD/../../../ and /mnt/gitfs/FRONT if a filesystem is already
involved?
i still didn't get around to trying out gitfs, sorry for the ignorance.
On Tue, Dec 24, 2024 at 5:40 AM <ori@eigenstate.org> wrote:
> Quoth ron minnich <rminnich@gmail.com>:
> > I think it pays to have a few of these convenience bits done. I use dit
> > diff commit..commit and git log commit..commit all the time.
> >
> > I am of the opinion that the 9front git is for the most part a real
> upgrade
> > from the original, but I do miss some of the conveniences.
> >
> > in any event, git/diff -c ref -c ref is not bad as a start!
>
> I don't like it much, but here's a first attempt; it now takes
> an expression for -c and diffs between the first and last result
> of the query, as in:
>
> git/diff -c HEAD~~~..front
>
> maybe someone else can come up with better.
>
> diff 248634879a9b78f08ddaeda9c7a50ba413fd4804 uncommitted
> --- a/sys/src/cmd/git/diff
> +++ b/sys/src/cmd/git/diff
> @@ -4,7 +4,7 @@
>
> gitup
>
> -flagfmt='c:commit branch, s:summarize, u:uncommitted'; args='[file ...]'
> +flagfmt='c:commit expr, s:summarize, u:uncommitted'; args='[file ...]'
> eval `''{aux/getflags $*} || exec aux/usage
>
> if(~ $#commit 0){
> @@ -19,7 +19,6 @@
> if(! ~ $#* 0)
> files=`{cleanname -d $gitrel $*}
>
> -branch=`{git/query -p $commit}
> if(~ $summarize 1 || ~ $uncommitted 1){
> git/walk -r$gitrel -f$filt $cparam $files
> exit
> @@ -26,13 +25,34 @@
> }
>
> showed=()
> -mntgen /mnt/scratch
> -bind $branch/tree/ /mnt/scratch/a
> -bind . /mnt/scratch/b
> bparam=()
> -if(~ $#commit 1)
> +if(~ $#commit 1){
> bparam=(-b $commit)
> -for(f in `$nl{git/walk $bparam -c -f$filt $cparam $files}){
> +mntgen /mnt/scratch
> +hashes=`{git/query $commit}
> +branch=`{git/query -p $hashes}
> +fn changed {
> + git/walk $bparam -c -f$filt $cparam $files
> +}
> +if(~ $#branch 0 || ! ~ $#branch $#hashes){
> + >[1=2] echo could not resolve branches for $commit
> + exit nobranch
> +}
> +if not if(~ $#branch 1){
> + bind $branch/tree/ /mnt/scratch/a
> + bind . /mnt/scratch/b
> +}
> +if not {
> + fn changed {
> + git/query -c $hashes(1)..$hashes($#hashes) | sed 's/^..//'
> + }
> + bind $branch(1)^/tree/ /mnt/scratch/a
> + bind $branch($#branch)^/tree /mnt/scratch/b
> +}
> +
> +echo $changed
> +for(f in `$nl{changed}){
> +echo $f
> if(~ $#showed 0){
> echo diff `{git/query $commit} uncommitted
> showed=1
>
>
[-- Attachment #2: Type: text/html, Size: 3434 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-12-24 14:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-23 4:29 [9front] equivalent of git log ron minnich
2024-12-23 4:49 ` ori
2024-12-23 10:00 ` hiro
2024-12-23 14:46 ` ron minnich
2024-12-23 15:54 ` ori
2024-12-23 18:20 ` ron minnich
2024-12-24 4:02 ` ori
2024-12-24 14:37 ` hiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).