ref: 232ac9a2ca5bb3d7990abee11b59805f95b036be
parent: 4c10b20ee85b5d2f4582137918dc014c2cd5aa7a
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 12 19:12:05 EST 2025
git/branch: change '-d' flag to '-r' flag for consistency '-d' is used relatively commonly for debug, '-r' is used within git fore 'remove'. bikeshed the flags.
--- a/sys/man/1/git
+++ b/sys/man/1/git
@@ -14,7 +14,7 @@
.PP
.B git/branch
[
-.B -admns
+.B -armns
]
[
.B -b
@@ -382,8 +382,8 @@
.B -s
option, the branch is created but the files are not checked out.
When passed the
-.B -d
-option, the branch is deleted.
+.B -r
+option, the branch is removed.
.PP
When switching branches, git/branch will refuse to clobber
modifications.
@@ -647,7 +647,7 @@
.PP
In order to create a new repository, run
.B git/init:
-.PP
+.IP
.EX
git/init myrepo
.EE
@@ -654,7 +654,7 @@
.PP
To clone an existing repository from a git server, run:
-.PP
+.IP
.EX
git/clone https://github.com/Harvey-OS/harvey
cd harvey
@@ -665,7 +665,7 @@
.PP
To set a user and email for commits, run:
-.PP
+.IP
.EX
% mkdir $home/lib/git
% >$home/lib/git/config echo '
@@ -702,4 +702,17 @@
.PP
There are some missing commands, features, and tools.
.PP
-git/compat only works within a git repository.
+Git/compat only works within a git repository.
+.PP
+Sharing git repositories between Plan 9 and Linux leads to indexes going out of sync.
+To work around this, reset the state of the tracked files on Plan 9 with git/add:
+.IP
+.EX
+git/add `{@{git/fs && git/walk -c}}
+.EE
+.PP
+And on Linux, with:
+.IP
+.EX
+git checkout HEAD -- $(find . -type f)
+.EE
--- a/sys/src/cmd/git/branch
+++ b/sys/src/cmd/git/branch
@@ -4,7 +4,7 @@
gitup
-flagfmt='a:listall, b:baseref ref, d:delete, n:newbr, s:stay, m:merge, M:nomod'
+flagfmt='a:listall, b:baseref ref, r:remove, n:newbr, s:stay, m:merge, M:nomod'
args='[branch]'
eval `''{aux/getflags $*} || exec aux/usage
--
⑨