Skip to content

add man page for the post-commit hook command#4052

Merged
chrisd8088 merged 4 commits intomasterfrom
chrisd/post-commit-man
Mar 3, 2020
Merged

add man page for the post-commit hook command#4052
chrisd8088 merged 4 commits intomasterfrom
chrisd/post-commit-man

Conversation

@chrisd8088
Copy link
Member

@chrisd8088 chrisd8088 commented Mar 3, 2020

Add a man page for git-lfs-post-commit(1) which largely parallels the git-lfs-post-merge(1) one, as they have similar purposes for Git LFS, namely, to ensure all tracked lockable files are marked read-only in the working copy.

This PR also updates the list of porcelain and plumbing commands in the main Git LFS man page, adding those which were missing (except for the deprecated git-lfs-clone(1)), including the git-lfs-post-commit(1) command.

Fixes #4048.
/cc @swisspol as reporter.

Add a man page for git-lfs-post-commit(1) which largely
parallels the git-lfs-post-merge(1) one, as they have similar
purposes for Git LFS, namely, to ensure all tracked lockable
files are marked read-only in the working copy.
@chrisd8088 chrisd8088 force-pushed the chrisd/post-commit-man branch from ad9052f to ae5d5b0 Compare March 3, 2020 02:01
Add a number of newer and plumbing commands to the main Git LFS
man page, if they were not listed there, except for git-lfs-clone(1)
which is deprecated per 67723dd and #3301.
@chrisd8088 chrisd8088 merged commit 94921b8 into master Mar 3, 2020
@chrisd8088 chrisd8088 deleted the chrisd/post-commit-man branch March 3, 2020 23:46
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request May 15, 2025
In PR git-lfs#1870, which was based on the work in PR git-lfs#1822, we introduced
support for "lockable" files whose permissions would be managed by
several new Git LFS commands such as "git lfs post-checkout" and
"git lfs post-merge", both of which we register as Git hooks.

In commit 585befa of PRs git-lfs#1822 and git-lfs#1870
we added manual pages for these two commands.  (Although these PRs
also introduced the "git lfs post-commit" command, they did not
include a manual page for it, so we added one belatedly in commit
ae5d5b0 of PR git-lfs#4052.)

From the time it was written, our git-lfs-post-checkout(1) manual page has
indicated that the command accepts three arguments.  This accurately
reflects the fact that Git will invoke our hook command with parameters
specifying the SHAs from before and after the checkout operation, plus
a status flag indicating whether a branch checkout was performed or not.

However, our manual page does not explain what values these arguments
are expected to contain, other than by dint of the names given to the
arguments in the page's synopsis section.  We therefore expand our
description of the "git lfs post-checkout" command to detail the values
Git will provide in each of the three arguments.

We also take the opportunity to adjust the name of the second argument
to clarify that we expect this parameter to contain a Git revision SHA
and not the name of a Git reference such as a branch or tag.  As well,
we replace the underscores in the argument names with hyphens to match
the style we use in all our other manual pages for the names of command
parameters.
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request May 15, 2025
In PR git-lfs#1870, which was based on the work in PR git-lfs#1822, we introduced
support for "lockable" files whose permissions would be managed by
several new Git LFS commands such as "git lfs post-checkout" and
"git lfs post-merge", both of which we register as Git hooks.

In commit 585befa of PRs git-lfs#1822 and git-lfs#1870
we added manual pages for these two commands.  (Although these PRs
also introduced the "git lfs post-commit" command, they did not
include a manual page for it, so we added one belatedly in commit
ae5d5b0 of PR git-lfs#4052.)

From the time it was written, our git-lfs-post-merge(1) manual page has
indicated that the command accepts a single "<is_squash>" argument.
This accurately reflects the fact that Git will invoke our hook command
with a single flag parameter that indicates whether or not a squash merge
was performed.

However, our "git lfs post-merge" command disregards this parameter
entirely, so we adjust our manual page now to clarify that this command
requires no arguments and ignores the one provided by Git.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There is no man page for "git lfs post-commit" hook

2 participants