Hi,
I'd like to make the following change to ./bin/g
diff --git a/bin/g b/bin/g
index 27fcf3f..01ee6bb 100755
--- a/bin/g
+++ b/bin/g
@@ -126,6 +126,7 @@ for DIR in * ; do
PWDLEN=`pwd | wc -c`
for I in "${FILES[@]}" ; do
unset FILES[$FILESNUM]
+ I=${I//@REPO@/${DIR}}
FILESNUM=$(($FILESNUM+1))
# filter out files that don't belong to this repo
if [ "${I:0:1}" = "/" ] ; then
The rational is this:
Some git operation need to be run, not only on each git repos, but
also with a parameter on the command line that reflect the current git
repo on which the command is run.
for example.
You want to modify the .git/config of each git repo to set the pushurl
appropriately:
./bin/g config remote.origin.pushurl
git+ssh//git.freedesktop.or/git/libreoffice/@REPO@
or you want to generate all the patches accumulated on all repo,
including the name of the repos in the patch names, and storing them
outside the tree in a subdirectory per repo:
g format-patch --suffix=-@REPO@.patch
--output-dir=/home/n_th/out_patches/@REPO@ master..HEAD
I used @REPO@ as a tag, because I didn't want to deal with escaping
nightmare, and @REPO@ is very unlikely to legitimately be on the
command line on its own right.
I am not attached to it, or to this particualr way of fixing this
problem. I just want to be able to run the two examples above (and
others similar) one way or another.
Norbert
Context
- [Libreoffice] modification of ./bin/g to allow git repository name substitution in the command line · Norbert Thiebaud
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.