From: "Karl Hasselström" <kha@treskal.com>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org
Subject: [PATCH] Lower priority of Cogito's default exclude patterns
Date: Sat, 07 Jan 2006 23:19:31 +0100 [thread overview]
Message-ID: <20060107221931.10616.25897.stgit@backpacker.hemma.treskal.com> (raw)
Put the default exclude patterns in a file referenced with
--exclude-from, instead of on the command line with --exclude. (The
existing behavior was bad since --exclude has higher priority than
--exclude-from and --exclude-per-directory, which made it impossible
for the user to override the default patterns.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
Makefile | 15 +++++++++++++--
cg-Xlib | 6 +++++-
cg-default-exclude | 6 ++++++
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 700491f..9ec9d07 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ prefix=$(HOME)
bindir=$(prefix)/bin
libdir=$(prefix)/lib/cogito
+sharedir=$(prefix)/share/cogito
INSTALL?=install
@@ -25,6 +26,8 @@ GEN_SCRIPT= cg-version
VERSION= VERSION
+SHARE_FILES= cg-default-exclude
+
### Build rules
@@ -62,6 +65,7 @@ test: all
### Installation rules
sedlibdir=$(shell echo $(libdir) | sed 's/\//\\\//g')
+sedsharedir=$(shell echo $(sharedir) | sed 's/\//\\\//g')
.PHONY: install install-cogito install-doc
install: install-cogito
@@ -83,14 +87,20 @@ install-cogito: $(SCRIPT) $(LIB_SCRIPT)
$(INSTALL) $(LIB_SCRIPT) $(DESTDIR)$(libdir)
cd $(DESTDIR)$(bindir); \
for file in $(SCRIPT) $(GEN_SCRIPT); do \
- sed -e 's/\$${COGITO_LIB}/"\$${COGITO_LIB:-$(sedlibdir)\/}"/g' $$file > $$file.new; \
+ sed -e 's/\$${COGITO_LIB}/"\$${COGITO_LIB:-$(sedlibdir)\/}"/g' $$file \
+ | sed -e 's/\$${COGITO_SHARE}/"\$${COGITO_SHARE:-$(sedsharedir)\/}"/g' \
+ > $$file.new; \
cat $$file.new > $$file; rm $$file.new; \
done
cd $(DESTDIR)$(libdir); \
for file in $(LIB_SCRIPT); do \
- sed -e 's/\$${COGITO_LIB}/"\$${COGITO_LIB:-$(sedlibdir)\/}"/g' $$file > $$file.new; \
+ sed -e 's/\$${COGITO_LIB}/"\$${COGITO_LIB:-$(sedlibdir)\/}"/g' $$file \
+ | sed -e 's/\$${COGITO_SHARE}/"\$${COGITO_SHARE:-$(sedsharedir)\/}"/g' \
+ > $$file.new; \
cat $$file.new > $$file; rm $$file.new; \
done
+ $(INSTALL) -m755 -d $(DESTDIR)$(sharedir)
+ $(INSTALL) -m644 $(SHARE_FILES) $(DESTDIR)$(sharedir)
install-doc:
$(MAKE) -C Documentation install
@@ -98,6 +108,7 @@ install-doc:
uninstall:
cd $(DESTDIR)$(bindir) && rm -f $(SCRIPT) $(GEN_SCRIPT)
cd $(DESTDIR)$(libdir) && rm -f $(LIB_SCRIPT)
+ cd $(DESTDIR)$(sharedir) && rm -f $(SHARE_FILES)
diff --git a/cg-Xlib b/cg-Xlib
index 46a8a73..b1d1561 100755
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -190,9 +190,13 @@ list_untracked_files()
excludeflag="$1"; shift
EXCLUDE=()
if [ "$excludeflag" != "no" -a "$excludeflag" != "noexclude" ]; then
- for excl in '*.[ao]' '.*' '!.gitignore' tags '*~' '#*' "$@"; do
+ for excl in "$@"; do
EXCLUDE[${#EXCLUDE[@]}]="--exclude=$excl"
done
+ EXCLUDEFILE="${COGITO_SHARE}cg-default-exclude"
+ if [ -f "$EXCLUDEFILE" ]; then
+ EXCLUDE[${#EXCLUDE[@]}]="--exclude-from=$EXCLUDEFILE"
+ fi
EXCLUDEFILE="$_git/info/exclude"
if [ -f "$EXCLUDEFILE" ]; then
EXCLUDE[${#EXCLUDE[@]}]="--exclude-from=$EXCLUDEFILE"
diff --git a/cg-default-exclude b/cg-default-exclude
new file mode 100644
index 0000000..f24dad6
--- /dev/null
+++ b/cg-default-exclude
@@ -0,0 +1,6 @@
+*.[ao]
+.*
+!.gitignore
+tags
+*~
+#*
next reply other threads:[~2006-01-07 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-07 22:19 Karl Hasselström [this message]
[not found] ` <20060119100712.GA12154@diana.vm.bytemark.co.uk>
2006-01-19 12:42 ` [PATCH] Lower priority of Cogito's default exclude patterns Petr Baudis
2006-01-19 14:07 ` Karl Hasselström
2006-01-21 2:04 ` Petr Baudis
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060107221931.10616.25897.stgit@backpacker.hemma.treskal.com \
--to=kha@treskal.com \
--cc=git@vger.kernel.org \
--cc=pasky@suse.cz \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox