Skip to content

Commit 0590c41

Browse files
committed
contrib: clarify a few points of usage
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 <[email protected]>
1 parent 117dd28 commit 0590c41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/filter-repo-demos/insert-beginning

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ near the top of git-filter-repo.
1414
"""
1515

1616
# Technically, this program could be replaced by a one-liner:
17-
# git filter-repo --force --commit-callback "if not commit.parents: commit.file_changes.append(FileChange(b'M', $PATHNAME, $(git hash-object -w $FILENAME), 100644))"
17+
# 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'))"
1818
# but let's do it as a full-fledged program that imports git_filter_repo
1919
# anyway...
2020

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

0 commit comments

Comments
 (0)