ref: e43ded677ea2a176f637ce90a6fa1b2ec038d09b
parent: f19481bc6ff48f9833294805b359896916a8b788
author: Ori Bernstein <[email protected]>
date: Thu Sep 3 22:03:56 EDT 2020
manpages: rename files in repository The .$N suffixes may conflict with object files. They don't right now, but why take the risk?
--- a/git.1
+++ /dev/null
@@ -1,492 +1,0 @@
-.TH GIT 1
-.SH NAME
-git, git/conf, git/query, git/walk, git/clone, git/branch,
-git/commit, git/diff, git/init, git/log, git/merge, git/push, git/pull, git/rm
-\- Manage git repositories.
-
-.SH SYNOPSIS
-.PP
-.B git/add
-[
-.B -r
-]
-.I path...
-.B git/rm
-.I path...
-.PP
-.B git/branch
-[
-.B -adns
-]
-[
-.B -b
-.I base
-]
-.I newbranch
-.PP
-.B git/clone
-[
-.I remote
-[
-.I local
-]
-]
-.PP
-.B git/commit
-[
-.B -m msg
-]
-.I file...
-.PP
-.B git/compat
-.PP
-.B git/conf
-[
-.B -r
-]
-[
-.B -f
-.I file
-]
-.I keys...
-.PP
-.B git/diff
-[
-.B -c
-.I branch
-]
-[
-.B -a
-]
-[
-.B -s
-]
-[
-.I file...
-]
-.PP
-.B git/revert
-[
-.B -c
-.I commit
-]
-.I file...
-.PP
-.B git/export
-[
-.I commits...
-]
-.PP
-.B git/import
-[
-.I commits...
-]
-.PP
-.B git/init
-[
-.B -b
-]
-[
-.I dir
-]
-[
-.B -u
-.I upstream
-]
-.PP
-.B git/log
-[
-.B -c
-.I commit
-.B | -q
-.I query
-]
-[
-.B -s
-]
-[
-.I files...
-]
-.PP
-.B git/merge
-.I theirs
-.PP
-.B git/pull
-[
-.B -f
-]
-[
-.B -q
-]
-[
-.B -a
-]
-[
-.B -u
-.I upstream
-]
-.PP
-.B git/push
-[
-.B -a
-]
-[
-.B -u
-.I upstream
-]
-[
-.B -b
-.I branch
-]
-[
-.B -r
-.I branch
-]
-.PP
-.B git/query
-[
-.B -pc
-]
-.I query
-.PP
-.B git/walk
-[
-.B -qc
-]
-[
-.B -b
-.I branch
-]
-[
-.B -f
-.I filters
-]
-[
-.I [files...]
-]
-
-.SH DESCRIPTION
-.PP
-Git is a distributed version control system.
-This means that each repository contains a full copy of the history.
-This history is then synced between computers as needed.
-
-.PP
-These programs provide tools to manage and interoperate with
-repositories hosted in git.
-
-.SH CONCEPTS
-
-Git stores snapshots of the working directory.
-Files can either be in a tracked or untracked state.
-Each commit takes the current version of all tracked files and
-adds them to a new commit.
-
-This history is stored in the
-.I .git
-directory.
-This suite of
-.I git
-tools provides a file interface to the
-.I .git
-directory mounted on
-.I /mnt/git.
-Modifications to the repository are done directly to the
-.I .git
-directory, and are reflected in the file system interface.
-This allows for easy scripting, without excessive complexity
-in the file API.
-
-.SH COMMANDS
-
-.PP
-.B Git/init
-is used to create a new git repository, with no code or commits.
-The repository is created in the current directory by default.
-Passing a directory name will cause the repository to be created
-there instead.
-Passing the
-.B -b
-option will cause the repository to be initialized as a bare repository.
-Passing the
-.B -u
-.I upstream
-option will cause the upstream to be configured to
-.I upstream.
-
-.PP
-.B Git/clone
-will take an existing repository, served over either the
-.I git://
-or
-.I ssh://
-protocols.
-The first argument is the repository to clone.
-The second argument, optionally, specifies the location to clone into.
-If not specified, the repository will be cloned into the last path component
-of the clone source, with the
-.I .git
-stripped off if present.
-
-.B Git/push
-is used to push the current changes to a remote repository.
-When no arguments are provided, the remote repository is taken from
-the origin configured in
-.I .git/config,
-and only the changes on the current branch are pushed.
-When passed the
-.I -a
-option, all branches are pushed.
-When passed the
-.I -u upstream
-option, the changed are pushed to
-.I upstream
-instead of the configured origin.
-When given the
-.I -r
-option, the branch is deleted from origin, instead of updated.
-
-.B Git/revert
-restores the named files from HEAD. When passed the -c flag, restores files from
-the named commit.
-
-.B Git/pull
-behaves in a similar manner to git/push, however it gets changes from
-the upstream repository.
-After fetching, it checks out the changes into the working directory.
-When passed the
-.I -f
-option, the update of the working copy is suppressed.
-When passed the
-.I -u upstream
-option, the changes are pulled from
-.I upstream
-instead of the configured origin.
-
-
-.PP
-Git/fs serves a file system on /mnt/git.
-For full documentation, see
-.I gitfs(4)
-
-.PP
-.B Git/add
-adds a file to the list of tracked files. When passed the
-.I -r
-flag, the file is removed from the list of tracked files.
-The copy of the file in the repository is left untouched.
-.PP
-.B Git/rm
-is an alias for
-.I git/add.
-
-.PP
-.B Git/commit
-creates a new commit which updates the files passed.
-
-.PP
-.B Git/branch
-is used to list or switch branches.
-When invoked with no arguments, it lists the current branch.
-To list all branches, pass the
-.I -a
-option.
-To switch between branches, pass a branch name.
-When passed the
-.I -n
-option, the branch will be created, overwriting existing branch.
-When passed the
-.I -b base
-option, the branch created is based off of
-.I base
-instead of
-.I HEAD.
-When passed the
-.I -s
-option, the branch is created but the files are not checked out.
-When passed the
-.I -d
-option, the branch is deleted.
-
-.PP
-.B Git/log
-shows a history of the current branch.
-When passed a list of files, only commits affecting
-those files are shown.
-The
-.I -c commit
-option logs starting from the provided commit, instead of HEAD.
-The
-.I -s
-option shows a summary of the commit, instead of the full message.
-The
-.I -e expr
-option shows commits matching the query expression provided.
-The expression is in the syntax of
-.B git/query.
-
-.PP
-.B Git/diff
-shows the differences between the currently checked out code and
-the
-.I HEAD
-commit.
-When passed the
-.I -c base
-option, the diff is computed against
-.I base
-instead of
-.I HEAD.
-When passed the
-.I -s
-option, only a the file statuses are
-printed.
-
-.PP
-.B Git/export
-exports a list of commits in a format that
-.B git/import
-can apply.
-
-.PP
-.B Git/import
-imports a commit with message, author, and
-date information.
-
-.PP
-.B Git/merge
-takes two branches and merges them filewise using
-.I ape/diff3.
-The next commit made will be a merge commmit.
-
-.PP
-.B Git/conf
-is a tool for querying the git configuration.
-The configuration key is provided as a dotted string. Spaces
-are accepted. For example, to find the URL of the origin
-repository, one might pass
-.I 'remote "origin".url".
-When given the
-.I -r
-option, the root of the current repository is printed.
-
-.B Git/query
-takes an expression describing a commit, or set of commits,
-and resolves it to a list of commits. With the
-.I -p
-option, instead of printing the commit hashes, the full
-path to their
-.B git/fs
-path is printed. With the
-.I -c
-option, the query must resolve to two commits. The blobs
-that have changed in the commits are printed.
-
-.PP
-.B Git/walk
-provides a tool for walking the list of tracked objects and printing their status.
-With no arguments, it prints a list of paths prefixed with the status character.
-When given the
-.I -c
-character, only the paths are printed.
-When given the
-.I -q
-option, all output is suppressed, and only the status is printed.
-When given the
-.I -f
-option, the output is filtered by status code, and only matching items are printed.
-
-.PP
-The status characters are as follows:
-.TP
-T
-Tracked, not modified since last commit.
-.TP
-M
-Modified since last commit.
-.TP
-R
-Removed from either working directory tracking list.
-.TP
-A
-Added, does not yet exist in a commit.
-
-.PP
-.B Git/compat
-spawns an rc subshell with a compatibility stub in
-.IR $path .
-This compatibility stub provides enough of the unix
-.I git
-commands to run tools like
-.I go get
-but not much more.
-
-.SH REF SYNTAX
-
-.PP
-Refs are specified with a simple query syntax.
-A bare hash always evaluates to itself.
-Ref names are resolved to their hashes.
-The
-.B a ^
-suffix operator finds the parent of a commit.
-The
-.B a b @
-suffix operator finds the common ancestor of the previous two commits.
-The
-.B a .. b
-or
-.B a : b
-operator finds all commits between
-.B a
-and
-.B b.
-Between is defined as the set of all commits which are ancestors of
-.B b
-and descendants of
-.B a.
-
-.SH EXAMPLES
-
-.PP
-In order to create a new repository, run
-.B git/init:
-
-.EX
-git/init myrepo
-.EE
-
-To clone an existing repository from a git server, run:
-.EX
-git/clone git://github.com/Harvey-OS/harvey
-cd harvey
-# edit files
-git/commit foo.c
-git/push
-.EE
-
-.SH FILES
-.TP .git
-.TP .git/config
-.TP $home/lib/git/config
-
-.SH SOURCE
-.B /sys/src/cmd/git
-
-.SH SEE ALSO
-.IR hg (1)
-.IR replica (1)
-.IR patch (1)
-.IR gitfs (4)
-.IR diff3
-
-.SH BUGS
-.PP
-Repositories with submodules are effectively read-only.
-
-.PP
-There are a number of missing commands, features, and tools. Notable
-missing features include
-.I http
-clones, history editing, and formatted patch management.
-
--- /dev/null
+++ b/git.1.man
@@ -1,0 +1,492 @@
+.TH GIT 1
+.SH NAME
+git, git/conf, git/query, git/walk, git/clone, git/branch,
+git/commit, git/diff, git/init, git/log, git/merge, git/push, git/pull, git/rm
+\- Manage git repositories.
+
+.SH SYNOPSIS
+.PP
+.B git/add
+[
+.B -r
+]
+.I path...
+.B git/rm
+.I path...
+.PP
+.B git/branch
+[
+.B -adns
+]
+[
+.B -b
+.I base
+]
+.I newbranch
+.PP
+.B git/clone
+[
+.I remote
+[
+.I local
+]
+]
+.PP
+.B git/commit
+[
+.B -m msg
+]
+.I file...
+.PP
+.B git/compat
+.PP
+.B git/conf
+[
+.B -r
+]
+[
+.B -f
+.I file
+]
+.I keys...
+.PP
+.B git/diff
+[
+.B -c
+.I branch
+]
+[
+.B -a
+]
+[
+.B -s
+]
+[
+.I file...
+]
+.PP
+.B git/revert
+[
+.B -c
+.I commit
+]
+.I file...
+.PP
+.B git/export
+[
+.I commits...
+]
+.PP
+.B git/import
+[
+.I commits...
+]
+.PP
+.B git/init
+[
+.B -b
+]
+[
+.I dir
+]
+[
+.B -u
+.I upstream
+]
+.PP
+.B git/log
+[
+.B -c
+.I commit
+.B | -q
+.I query
+]
+[
+.B -s
+]
+[
+.I files...
+]
+.PP
+.B git/merge
+.I theirs
+.PP
+.B git/pull
+[
+.B -f
+]
+[
+.B -q
+]
+[
+.B -a
+]
+[
+.B -u
+.I upstream
+]
+.PP
+.B git/push
+[
+.B -a
+]
+[
+.B -u
+.I upstream
+]
+[
+.B -b
+.I branch
+]
+[
+.B -r
+.I branch
+]
+.PP
+.B git/query
+[
+.B -pc
+]
+.I query
+.PP
+.B git/walk
+[
+.B -qc
+]
+[
+.B -b
+.I branch
+]
+[
+.B -f
+.I filters
+]
+[
+.I [files...]
+]
+
+.SH DESCRIPTION
+.PP
+Git is a distributed version control system.
+This means that each repository contains a full copy of the history.
+This history is then synced between computers as needed.
+
+.PP
+These programs provide tools to manage and interoperate with
+repositories hosted in git.
+
+.SH CONCEPTS
+
+Git stores snapshots of the working directory.
+Files can either be in a tracked or untracked state.
+Each commit takes the current version of all tracked files and
+adds them to a new commit.
+
+This history is stored in the
+.I .git
+directory.
+This suite of
+.I git
+tools provides a file interface to the
+.I .git
+directory mounted on
+.I /mnt/git.
+Modifications to the repository are done directly to the
+.I .git
+directory, and are reflected in the file system interface.
+This allows for easy scripting, without excessive complexity
+in the file API.
+
+.SH COMMANDS
+
+.PP
+.B Git/init
+is used to create a new git repository, with no code or commits.
+The repository is created in the current directory by default.
+Passing a directory name will cause the repository to be created
+there instead.
+Passing the
+.B -b
+option will cause the repository to be initialized as a bare repository.
+Passing the
+.B -u
+.I upstream
+option will cause the upstream to be configured to
+.I upstream.
+
+.PP
+.B Git/clone
+will take an existing repository, served over either the
+.I git://
+or
+.I ssh://
+protocols.
+The first argument is the repository to clone.
+The second argument, optionally, specifies the location to clone into.
+If not specified, the repository will be cloned into the last path component
+of the clone source, with the
+.I .git
+stripped off if present.
+
+.B Git/push
+is used to push the current changes to a remote repository.
+When no arguments are provided, the remote repository is taken from
+the origin configured in
+.I .git/config,
+and only the changes on the current branch are pushed.
+When passed the
+.I -a
+option, all branches are pushed.
+When passed the
+.I -u upstream
+option, the changed are pushed to
+.I upstream
+instead of the configured origin.
+When given the
+.I -r
+option, the branch is deleted from origin, instead of updated.
+
+.B Git/revert
+restores the named files from HEAD. When passed the -c flag, restores files from
+the named commit.
+
+.B Git/pull
+behaves in a similar manner to git/push, however it gets changes from
+the upstream repository.
+After fetching, it checks out the changes into the working directory.
+When passed the
+.I -f
+option, the update of the working copy is suppressed.
+When passed the
+.I -u upstream
+option, the changes are pulled from
+.I upstream
+instead of the configured origin.
+
+
+.PP
+Git/fs serves a file system on /mnt/git.
+For full documentation, see
+.I gitfs(4)
+
+.PP
+.B Git/add
+adds a file to the list of tracked files. When passed the
+.I -r
+flag, the file is removed from the list of tracked files.
+The copy of the file in the repository is left untouched.
+.PP
+.B Git/rm
+is an alias for
+.I git/add.
+
+.PP
+.B Git/commit
+creates a new commit which updates the files passed.
+
+.PP
+.B Git/branch
+is used to list or switch branches.
+When invoked with no arguments, it lists the current branch.
+To list all branches, pass the
+.I -a
+option.
+To switch between branches, pass a branch name.
+When passed the
+.I -n
+option, the branch will be created, overwriting existing branch.
+When passed the
+.I -b base
+option, the branch created is based off of
+.I base
+instead of
+.I HEAD.
+When passed the
+.I -s
+option, the branch is created but the files are not checked out.
+When passed the
+.I -d
+option, the branch is deleted.
+
+.PP
+.B Git/log
+shows a history of the current branch.
+When passed a list of files, only commits affecting
+those files are shown.
+The
+.I -c commit
+option logs starting from the provided commit, instead of HEAD.
+The
+.I -s
+option shows a summary of the commit, instead of the full message.
+The
+.I -e expr
+option shows commits matching the query expression provided.
+The expression is in the syntax of
+.B git/query.
+
+.PP
+.B Git/diff
+shows the differences between the currently checked out code and
+the
+.I HEAD
+commit.
+When passed the
+.I -c base
+option, the diff is computed against
+.I base
+instead of
+.I HEAD.
+When passed the
+.I -s
+option, only a the file statuses are
+printed.
+
+.PP
+.B Git/export
+exports a list of commits in a format that
+.B git/import
+can apply.
+
+.PP
+.B Git/import
+imports a commit with message, author, and
+date information.
+
+.PP
+.B Git/merge
+takes two branches and merges them filewise using
+.I ape/diff3.
+The next commit made will be a merge commmit.
+
+.PP
+.B Git/conf
+is a tool for querying the git configuration.
+The configuration key is provided as a dotted string. Spaces
+are accepted. For example, to find the URL of the origin
+repository, one might pass
+.I 'remote "origin".url".
+When given the
+.I -r
+option, the root of the current repository is printed.
+
+.B Git/query
+takes an expression describing a commit, or set of commits,
+and resolves it to a list of commits. With the
+.I -p
+option, instead of printing the commit hashes, the full
+path to their
+.B git/fs
+path is printed. With the
+.I -c
+option, the query must resolve to two commits. The blobs
+that have changed in the commits are printed.
+
+.PP
+.B Git/walk
+provides a tool for walking the list of tracked objects and printing their status.
+With no arguments, it prints a list of paths prefixed with the status character.
+When given the
+.I -c
+character, only the paths are printed.
+When given the
+.I -q
+option, all output is suppressed, and only the status is printed.
+When given the
+.I -f
+option, the output is filtered by status code, and only matching items are printed.
+
+.PP
+The status characters are as follows:
+.TP
+T
+Tracked, not modified since last commit.
+.TP
+M
+Modified since last commit.
+.TP
+R
+Removed from either working directory tracking list.
+.TP
+A
+Added, does not yet exist in a commit.
+
+.PP
+.B Git/compat
+spawns an rc subshell with a compatibility stub in
+.IR $path .
+This compatibility stub provides enough of the unix
+.I git
+commands to run tools like
+.I go get
+but not much more.
+
+.SH REF SYNTAX
+
+.PP
+Refs are specified with a simple query syntax.
+A bare hash always evaluates to itself.
+Ref names are resolved to their hashes.
+The
+.B a ^
+suffix operator finds the parent of a commit.
+The
+.B a b @
+suffix operator finds the common ancestor of the previous two commits.
+The
+.B a .. b
+or
+.B a : b
+operator finds all commits between
+.B a
+and
+.B b.
+Between is defined as the set of all commits which are ancestors of
+.B b
+and descendants of
+.B a.
+
+.SH EXAMPLES
+
+.PP
+In order to create a new repository, run
+.B git/init:
+
+.EX
+git/init myrepo
+.EE
+
+To clone an existing repository from a git server, run:
+.EX
+git/clone git://github.com/Harvey-OS/harvey
+cd harvey
+# edit files
+git/commit foo.c
+git/push
+.EE
+
+.SH FILES
+.TP .git
+.TP .git/config
+.TP $home/lib/git/config
+
+.SH SOURCE
+.B /sys/src/cmd/git
+
+.SH SEE ALSO
+.IR hg (1)
+.IR replica (1)
+.IR patch (1)
+.IR gitfs (4)
+.IR diff3
+
+.SH BUGS
+.PP
+Repositories with submodules are effectively read-only.
+
+.PP
+There are a number of missing commands, features, and tools. Notable
+missing features include
+.I http
+clones, history editing, and formatted patch management.
+
--- a/gitfs.4
+++ /dev/null
@@ -1,112 +1,0 @@
-.TH GITFS 4
-.SH NAME
-git/fs \- git file server
-
-.SH SYNOPSIS
-
-git/fs
-[
-.B -d
-]
-[
-.B -m
-.I mtpt
-]
-
-.SH DESCRIPTION
-
-.PP
-Git/fs serves a file system interface to a git repository in the
-current directory.
-This file system provides a read-only view into the repository contents.
-By default, it is mounted on
-.B /mnt/git.
-It does not cache mutable data, so any changes to the git repository will immediately be reflected in git/fs.
-
-.PP
-Git/fs serves a few levels of hierarchy.
-The top level contains the following files and directories:
-
-.TP
-.B branch
-Exposes branches. Branches are aliases for commit objects.
-
-.TP
-.B object
-Exposes all objects in the git repository.
-Objects may be commits, trees, or blobs.
-
-.TP
-.B HEAD
-This is an alias for the current commit.
-
-.PP
-Commits are also represented as small hierarchies. They contain
-the following files:
-
-.TP
-.B author
-This is the author of the commit.
-The contents of this file are free-form text, but conventionally
-they take the form
-.B Full Name <[email protected]>
-
-.TP
-.B hash
-The commit id of the current branch
-
-.TP
-.B msg
-The full text of the commit message.
-
-.TP
-.B parent
-The list of parent commit ids of the current commit.
-One parent is listed per line.
-
-.TP
-.B tree
-A directory containing the tree associated with the
-commit.
-The timestamp of the files contained within this
-hierarchy are the same as the date of the commit.
-
-.PP
-Trees are presented as directory listings, and blobs
-as files.
-
-.SH FILES
-.TP
-.B .git
-The git repository being expected.
-.TP
-.B .git/HEAD
-A reference to the current HEAD.
-Used to populate
-.B /mnt/git/HEAD
-.TP
-.git/config
-The per-repository configuation for git tools.
-.TP
-.B $home/lib/git/config
-The global configuration for git tools.
-
-.SH SOURCE
-.TP
-.B /sys/src/cmd/git/fs.c
-
-.SH "SEE ALSO"
-.IR git (1)
-.IR hg (1)
-.IR hgfs (4)
-
-.SH BUGS
-Symlinks are only partially supported.
-Symlinks are treated as regular files when reading.
-Modifying symlinks is unsupported.
-
-.PP
-There is no way to inspect the raw objects. This is
-a feature that would be useful for debugging.
-
-
--- /dev/null
+++ b/gitfs.4.man
@@ -1,0 +1,112 @@
+.TH GITFS 4
+.SH NAME
+git/fs \- git file server
+
+.SH SYNOPSIS
+
+git/fs
+[
+.B -d
+]
+[
+.B -m
+.I mtpt
+]
+
+.SH DESCRIPTION
+
+.PP
+Git/fs serves a file system interface to a git repository in the
+current directory.
+This file system provides a read-only view into the repository contents.
+By default, it is mounted on
+.B /mnt/git.
+It does not cache mutable data, so any changes to the git repository will immediately be reflected in git/fs.
+
+.PP
+Git/fs serves a few levels of hierarchy.
+The top level contains the following files and directories:
+
+.TP
+.B branch
+Exposes branches. Branches are aliases for commit objects.
+
+.TP
+.B object
+Exposes all objects in the git repository.
+Objects may be commits, trees, or blobs.
+
+.TP
+.B HEAD
+This is an alias for the current commit.
+
+.PP
+Commits are also represented as small hierarchies. They contain
+the following files:
+
+.TP
+.B author
+This is the author of the commit.
+The contents of this file are free-form text, but conventionally
+they take the form
+.B Full Name <[email protected]>
+
+.TP
+.B hash
+The commit id of the current branch
+
+.TP
+.B msg
+The full text of the commit message.
+
+.TP
+.B parent
+The list of parent commit ids of the current commit.
+One parent is listed per line.
+
+.TP
+.B tree
+A directory containing the tree associated with the
+commit.
+The timestamp of the files contained within this
+hierarchy are the same as the date of the commit.
+
+.PP
+Trees are presented as directory listings, and blobs
+as files.
+
+.SH FILES
+.TP
+.B .git
+The git repository being expected.
+.TP
+.B .git/HEAD
+A reference to the current HEAD.
+Used to populate
+.B /mnt/git/HEAD
+.TP
+.git/config
+The per-repository configuation for git tools.
+.TP
+.B $home/lib/git/config
+The global configuration for git tools.
+
+.SH SOURCE
+.TP
+.B /sys/src/cmd/git/fs.c
+
+.SH "SEE ALSO"
+.IR git (1)
+.IR hg (1)
+.IR hgfs (4)
+
+.SH BUGS
+Symlinks are only partially supported.
+Symlinks are treated as regular files when reading.
+Modifying symlinks is unsupported.
+
+.PP
+There is no way to inspect the raw objects. This is
+a feature that would be useful for debugging.
+
+
--- a/mkfile
+++ b/mkfile
@@ -50,8 +50,8 @@
mk $MKFLAGS $i.install
for (i in $RC)
mk $MKFLAGS $i.rcinstall
- cp git.1 /sys/man/1/git
- cp gitfs.4 /sys/man/4/gitfs
+ cp git.1.man /sys/man/1/git
+ cp gitfs.4.man /sys/man/4/gitfs
cp common.rc /sys/lib/git/common.rc
mk $MKFLAGS /sys/lib/git/template