From: shawn wilson <ag4ve.us@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: git alias quoting help
Date: Wed, 30 Mar 2016 00:13:30 -0400 [thread overview]
Message-ID: <CAH_OBievBBjzLwPZf3-qLn-SQyJG0UHhbdkvyZFfC8b-TsTUJQ@mail.gmail.com> (raw)
I've also tried to make this a plain bash script (w/o the function or
if statements and am failing at the same place). The issue seems to be
with the quoting in the filter-branch | ls-files bit. Also, the end
goal here is to be able to move a directory from one repo and keep the
history. While this works if I do it at the command line, it's just
too many steps (is tedious). Also, if there's a way to do the same
thing with multiple directories in one shot, (or make this work with
something like: cookbooks/{a,b,c} # as a parameter) that'd be perfect.
reapdir = "!f() { \
if [ -d "$1" ] ; then \
git filter-branch --prune-empty --subdirectory-filter "$1" -- --all && \
git gc --aggressive && \
git prune && \
git filter-branch -f --prune-empty --index-filter '\
git ls-files -s \
| sed \"s-\\t-&$1-\" \
| GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index
--index-info && \
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE'; \
else \
echo "No directory $1"; \
fi; }; \
f"
next reply other threads:[~2016-03-30 4:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 4:13 shawn wilson [this message]
2016-03-31 14:27 ` git alias quoting help shawn wilson
2016-04-01 6:10 ` shawn wilson
2016-04-01 10:30 ` shawn wilson
2016-04-01 11:05 ` Christian Couder
2016-04-01 12:21 ` shawn wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAH_OBievBBjzLwPZf3-qLn-SQyJG0UHhbdkvyZFfC8b-TsTUJQ@mail.gmail.com \
--to=ag4ve.us@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).