Skip to content

Commit

Permalink
contrib: clarify a few points of usage
Browse files Browse the repository at this point in the history
Make it clearer that absolute paths should not be used for pathnames
within a git repository.  Also, fix the comment about how the
insert-beginning script could be implemented as a one-liner; the
example commented-out code should have used bytestrings.

Signed-off-by: Elijah Newren <newren@gmail.com>
  • Loading branch information
newren committed Nov 25, 2019
1 parent 76d48d0 commit 4de3861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/filter-repo-demos/insert-beginning
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ near the top of git-filter-repo.
"""

# Technically, this program could be replaced by a one-liner:
# git filter-repo --force --commit-callback "if not commit.parents: commit.file_changes.append(FileChange(b'M', $PATHNAME, $(git hash-object -w $FILENAME), 100644))"
# git filter-repo --force --commit-callback "if not commit.parents: commit.file_changes.append(FileChange(b'M', $RELATIVE_TO_PROJECT_ROOT_PATHNAME, b'$(git hash-object -w $FILENAME)', b'100644'))"
# but let's do it as a full-fledged program that imports git_filter_repo
# anyway...

Expand All @@ -29,7 +29,7 @@ except ImportError:
parser = argparse.ArgumentParser(
description='Add a file to the root commit(s) of history')
parser.add_argument('--file', type=os.fsencode,
help=("Path to file whose contents should be added to root commit(s)"))
help=("Relative-path to file whose contents should be added to root commit(s)"))
args = parser.parse_args()
if not args.file:
raise SystemExit("Error: Need to specify the --file option")
Expand Down

0 comments on commit 4de3861

Please sign in to comment.