From 13354f5377d82baee4d8c930df824c8dbeda396d Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 17 Aug 2009 02:19:17 -0400 Subject: [PATCH 1/3] docs: describe impact of repack on "clone -s" The effects of repacking on a repository with alternates are a bit subtle. The two main things users will want are: 1. Not to waste disk space by accidentally copying objects which could be shared. 2. Copying all objects explicitly to break the dependency on the source repo. This patch describes both under the "clone -s" documentation. It makes sense to put it there rather than in git-repack.txt for both cases. For (1), we are warning the user who is using "clone -s" about what _not_ to do, so we need to get their attention when reading about "clone -s". For (2), we are telling them how git-repack can be used to accomplish a task, but until they know that git-repack is the right tool, they have no reason to look at the repack documentation. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index b14de6c407..2c63a0fbae 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -72,8 +72,16 @@ These objects may be removed by normal git operations (such as 'git-commit') which automatically call `git gc --auto`. (See linkgit:git-gc[1].) If these objects are removed and were referenced by the cloned repository, then the cloned repository will become corrupt. - - ++ +Note that running `git repack` without the `-l` option in a repository +cloned with `-s` will copy objects from the source repository into a pack +in the cloned repository, removing the disk space savings of `clone -s`. +It is safe, however, to run `git gc`, which uses the `-l` option by +default. ++ +If you want to break the dependency of a repository cloned with `-s` on +its source repository, you can simply run `git repack -a` to copy all +objects from the source repository into a pack in the cloned repository. --reference :: If the reference repository is on the local machine From b8f423327bea8b82f1cd08cbed52a54a757de856 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 17 Aug 2009 22:38:46 +0200 Subject: [PATCH 2/3] filter-branch: add an example how to add ACKs to a range of commits When you have to add certain lines like ACKs (or for that matter, Signed-off-by:s) to a range of commits starting with HEAD, you might be tempted to use 'git rebase -i -10', but that is a waste of your time. It is better to use 'git filter-branch' with an appropriate message filter, and this commit adds an example how to do so to filter-branch's man page. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/git-filter-branch.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index ab527b5b31..32ea8564a5 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -305,6 +305,16 @@ range in addition to the new branch name. The new branch name will point to the top-most revision that a 'git-rev-list' of this range will print. +If you need to add 'Acked-by' lines to, say, the last 10 commits (none +of which is a merge), use this command: + +-------------------------------------------------------- +git filter-branch --msg-filter ' + cat && + echo "Acked-by: Bugs Bunny " +' HEAD~10..HEAD +-------------------------------------------------------- + *NOTE* the changes introduced by the commits, and which are not reverted by subsequent commits, will still be in the rewritten branch. If you want to throw out _changes_ together with the commits, you should use the From 83e355a62cd05fba4533d59f9ab4e104c0596279 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Tue, 18 Aug 2009 11:51:00 +0200 Subject: [PATCH 3/3] filter-branch: make the usage string fit on 80 chars terminals. It used to be a single, huge line, badly wrapped by xterm. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- git-filter-branch.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 37e044db40..a480d6fc70 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -97,12 +97,12 @@ set_ident () { echo "case \"\$GIT_${uid}_NAME\" in \"\") GIT_${uid}_NAME=\"\${GIT_${uid}_EMAIL%%@*}\" && export GIT_${uid}_NAME;; esac" } -USAGE="[--env-filter ] [--tree-filter ] \ -[--index-filter ] [--parent-filter ] \ -[--msg-filter ] [--commit-filter ] \ -[--tag-name-filter ] [--subdirectory-filter ] \ -[--original ] [-d ] [-f | --force] \ -[...]" +USAGE="[--env-filter ] [--tree-filter ] + [--index-filter ] [--parent-filter ] + [--msg-filter ] [--commit-filter ] + [--tag-name-filter ] [--subdirectory-filter ] + [--original ] [-d ] [-f | --force] + [...]" OPTIONS_SPEC= . git-sh-setup