* [PATCH] Provide pessimistic defaults for cross compilation tests.
From: Ralf Wildenhues @ 2009-01-19 20:34 UTC (permalink / raw)
To: Julius Naperkowski, git
In-Reply-To: <20090116094110.GD25275@ins.uni-bonn.de>
In a cross compile setup, configure tests that run programs
cannot be executed; in that case, provide pessimistic default
values.
Bug reported by Julius Naperkowski.
---
> I can post a patch to add sane default settings for AC_RUN_IFELSE in
> cross compile setups, this weekend.
configure.ac | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 363547c..4a208d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,6 +360,7 @@ AC_RUN_IFELSE(
else if (strcmp(buf, "12345"))
return 2;]])],
[ac_cv_c_c99_format=yes],
+ [ac_cv_c_c99_format=no],
[ac_cv_c_c99_format=no])
])
if test $ac_cv_c_c99_format = no; then
@@ -380,6 +381,7 @@ AC_RUN_IFELSE(
FILE *f = fopen(".", "r");
return f && fread(&c, 1, 1, f)]])],
[ac_cv_fread_reads_directories=no],
+ [ac_cv_fread_reads_directories=yes],
[ac_cv_fread_reads_directories=yes])
])
if test $ac_cv_fread_reads_directories = yes; then
@@ -414,6 +416,7 @@ AC_RUN_IFELSE(
if (snprintf(buf, 3, "%s", "12345") != 5
|| strcmp(buf, "12")) return 1]])],
[ac_cv_snprintf_returns_bogus=no],
+ [ac_cv_snprintf_returns_bogus=yes],
[ac_cv_snprintf_returns_bogus=yes])
])
if test $ac_cv_snprintf_returns_bogus = yes; then
--
1.6.1.137.g3d9e8
^ permalink raw reply related
* [PATCH] Fix naming scheme for configure cache variables.
From: Ralf Wildenhues @ 2009-01-19 20:34 UTC (permalink / raw)
To: git
In order to be cached, configure variables need to contain the
string '_cv_', and they should begin with a package-specific
prefix in order to avoid interfering with third-party macros.
Rename ld_dashr, ld_wl_rpath, ld_rpath to git_cv_ld_dashr etc.
---
This avoids a warning with newer autoconf versions about the naming of
the cache variables, and makes the caching work for them.
As to the 'git_' prefix, it could be argued that the other cache
variables used in configure.ac should also be renamed s/ac_/git_/
If you like, I can provide a patch for those, too.
Thanks,
Ralf
configure.ac | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0a5fc8c..363547c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,31 +114,31 @@ AC_MSG_NOTICE([CHECKS for programs])
#
AC_PROG_CC([cc gcc])
# which switch to pass runtime path to dynamic libraries to the linker
-AC_CACHE_CHECK([if linker supports -R], ld_dashr, [
+AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [
SAVE_LDFLAGS="${LDFLAGS}"
LDFLAGS="${SAVE_LDFLAGS} -R /"
- AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_dashr=yes], [ld_dashr=no])
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_dashr=yes], [git_cv_ld_dashr=no])
LDFLAGS="${SAVE_LDFLAGS}"
])
-if test "$ld_dashr" = "yes"; then
+if test "$git_cv_ld_dashr" = "yes"; then
AC_SUBST(CC_LD_DYNPATH, [-R])
else
- AC_CACHE_CHECK([if linker supports -Wl,-rpath,], ld_wl_rpath, [
+ AC_CACHE_CHECK([if linker supports -Wl,-rpath,], git_cv_ld_wl_rpath, [
SAVE_LDFLAGS="${LDFLAGS}"
LDFLAGS="${SAVE_LDFLAGS} -Wl,-rpath,/"
- AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_wl_rpath=yes], [ld_wl_rpath=no])
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_wl_rpath=yes], [git_cv_ld_wl_rpath=no])
LDFLAGS="${SAVE_LDFLAGS}"
])
- if test "$ld_wl_rpath" = "yes"; then
+ if test "$git_cv_ld_wl_rpath" = "yes"; then
AC_SUBST(CC_LD_DYNPATH, [-Wl,-rpath,])
else
- AC_CACHE_CHECK([if linker supports -rpath], ld_rpath, [
+ AC_CACHE_CHECK([if linker supports -rpath], git_cv_ld_rpath, [
SAVE_LDFLAGS="${LDFLAGS}"
LDFLAGS="${SAVE_LDFLAGS} -rpath /"
- AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_rpath=yes], [ld_rpath=no])
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_rpath=yes], [git_cv_ld_rpath=no])
LDFLAGS="${SAVE_LDFLAGS}"
])
- if test "$ld_rpath" = "yes"; then
+ if test "$git_cv_ld_rpath" = "yes"; then
AC_SUBST(CC_LD_DYNPATH, [-rpath])
else
AC_MSG_WARN([linker does not support runtime path to dynamic libraries])
--
1.6.1.137.g3d9e8
^ permalink raw reply related
* Re: how to track multiple upstreams in one repository
From: Julian Phillips @ 2009-01-19 20:45 UTC (permalink / raw)
To: david; +Cc: git
In-Reply-To: <alpine.DEB.1.10.0901191308030.2428@asgard.lang.hm>
On Mon, 19 Jan 2009, david@lang.hm wrote:
> On Mon, 19 Jan 2009, Julian Phillips wrote:
>
>> On Sun, 18 Jan 2009, david@lang.hm wrote:
>>
>> > for linux I want to track both the linus tree and the -stable tree.
>> > Ideally I want to be able to do a checkout of tags from either tree from
>> > the same directory (along with diffs between items in both trees, etc)
>> >
>> > I have found documentation on how to clone from each of them, but I
>> > haven't found any simple documentation on how to work with both of them.
>>
>> You could always just use
>> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6-stable.git
>> ? It already contains both the linus tree and all the stable trees ...
>
> I know it contains the releases, but does it contain the -rc trees?
It seems to contain everything from the main Linus tree as far as I can
see from the gitweb (haven't actually used it for kernel work).
>
> David Lang
>
>
--
Julian
---
Stock's Observation:
You no sooner get your head above water but what someone pulls
your flippers off.
^ permalink raw reply
* [PATCH v2 1/2] bash completion: move pickaxe options to log
From: Thomas Rast @ 2009-01-19 21:17 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Junio C Hamano
In-Reply-To: <20090119173153.GB14053@spearce.org>
Move the options --pickaxe-all and --pickaxe-regex to git-log, where
they make more sense than with git-diff.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
Shawn O. Pearce wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> > The changes around pickaxe made me "Huh?". For log pickaxe makes very
> > good sense but for a single diff it doesn't, yet the original seems to
> > have had them only on "git diff" and not on "git log", which feels wrong.
>
> I agree completely. The pickaxe stuff in current completion is
> just plain wrong. I'd like to see it fixed with this cleanup.
> Maybe do it in two parts; fix the pickaxe options to be on log
> and not diff, and then do the cleanup for the common options.
Good point. Sorry for not noticing in the first place; I was too
focused on just getting git-show completion working ;-)
contrib/completion/git-completion.bash | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 60497a4..b5d3bbb 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -784,7 +784,7 @@ _git_diff ()
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
--full-index --binary --abbrev --diff-filter=
- --find-copies-harder --pickaxe-all --pickaxe-regex
+ --find-copies-harder
--text --ignore-space-at-eol --ignore-space-change
--ignore-all-space --exit-code --quiet --ext-diff
--no-ext-diff
@@ -986,6 +986,7 @@ _git_log ()
--parents --children --full-history
--merge
--inter-hunk-context=
+ --pickaxe-all --pickaxe-regex
"
return
;;
--
tg: (28da86a..) t/bash-complete-pickaxe (depends on: origin/master)
^ permalink raw reply related
* [PATCH v2 2/2] bash completion: refactor diff options
From: Thomas Rast @ 2009-01-19 21:18 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Junio C Hamano
In-Reply-To: <1232399880-22036-1-git-send-email-trast@student.ethz.ch>
diff, log and show all take the same diff options. Refactor them from
__git_diff and __git_log into a variable, and complete them in
__git_show too.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
contrib/completion/git-completion.bash | 36 ++++++++++++++++++-------------
1 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 096603b..bfae953 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -773,14 +773,7 @@ _git_describe ()
__gitcomp "$(__git_refs)"
}
-_git_diff ()
-{
- __git_has_doubledash && return
-
- local cur="${COMP_WORDS[COMP_CWORD]}"
- case "$cur" in
- --*)
- __gitcomp "--cached --stat --numstat --shortstat --summary
+__git_diff_common_options="--stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
--full-index --binary --abbrev --diff-filter=
@@ -789,9 +782,21 @@ _git_diff ()
--ignore-all-space --exit-code --quiet --ext-diff
--no-ext-diff
--no-prefix --src-prefix= --dst-prefix=
- --base --ours --theirs
--inter-hunk-context=
--patience
+ --raw
+"
+
+_git_diff ()
+{
+ __git_has_doubledash && return
+
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "--cached --pickaxe-all --pickaxe-regex
+ --base --ours --theirs
+ $__git_diff_common_options
"
return
;;
@@ -977,17 +982,16 @@ _git_log ()
--relative-date --date=
--author= --committer= --grep=
--all-match
- --pretty= --name-status --name-only --raw
+ --pretty=
--not --all
--left-right --cherry-pick
--graph
- --stat --numstat --shortstat
- --decorate --diff-filter=
- --color-words --walk-reflogs
+ --decorate
+ --walk-reflogs
--parents --children --full-history
--merge
--inter-hunk-context=
- --patience
+ $__git_diff_common_options
--pickaxe-all --pickaxe-regex
"
return
@@ -1492,7 +1496,9 @@ _git_show ()
return
;;
--*)
- __gitcomp "--pretty="
+ __gitcomp "--pretty=
+ $__git_diff_common_options
+ "
return
;;
esac
--
tg: (3f8c856..) t/bash-complete-show (depends on: origin/next t/bash-complete-pickaxe t/bash-complete-pickaxe)
^ permalink raw reply related
* [PATCH v2] bash: offer to show (un)staged changes
From: Thomas Rast @ 2009-01-19 21:38 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Junio C Hamano
In-Reply-To: <20090119172939.GA14053@spearce.org>
Add a bit of code to __git_ps1 that lets it append '*' to the branch
name if there are any unstaged changes, and '+' if there are any
staged changes.
Since this is a rather expensive operation and will force a lot of
data into the cache whenever you first enter a repository, you have to
enable it manually by setting bash.showDirtyState to a true value.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
Shawn O. Pearce wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> > This makes the feature unavailable for people who care about the stat
> > dirtiness and explicitly set diff.autorefreshindex to false, doesn't it?
>
> Yup, and I'm one of those people who sets autorefresindex to false
> in my ~/.gitconfig, usually before I even have user.{name,email} set.
I tried to alleviate the problem with a combination of diff options
that hopefully does the right thing in all cases.
> I do like the idea of what Thomas is trying to do here, but its
> so bloody expensive to compute dirty state on every prompt in
> some repositories that I'd shoot myself. E.g. WebKit is huge,
> computing the dirty state inside of the WebKit repository on each
> prompt would absolutely kill CLI performance to a point of it not
> being usuable. But git.git is small enough its OK on pretty much
> everything except Cygwin.
>
> So as much as I'd like to use this without the update-index --refresh
> bit, I'm not sure its viable in every project out there.
I mostly work on small-ish repos, and while the initial loading is
_very_ noticeable, it's ok after that. But your point about repos
being different is very good, so I changed the patch to use a
git-config variable instead of a shell environment variable. That
way, you could even configure it to a different setting per-repo.
(Which might end up rather confusing, but at least it's possible.)
contrib/completion/git-completion.bash | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index f8b845a..7864ca7 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -34,6 +34,10 @@
# are currently in a git repository. The %s token will be
# the name of the current branch.
#
+# In addition, if you set bash.showDirtyState to a true value,
+# unstaged (*) and staged (+) changes will be shown next to the
+# branch name.
+#
# To submit patches:
#
# *) Read Documentation/SubmittingPatches
@@ -116,10 +120,24 @@ __git_ps1 ()
fi
fi
+ local w
+ local i
+
+ if test "$(git config --bool bash.showDirtyState)" = "true"; then
+ git diff --no-ext-diff --ignore-submodules \
+ --quiet --exit-code || w="*"
+ if git rev-parse --quiet --verify HEAD >/dev/null; then
+ git diff-index --cached --quiet \
+ --ignore-submodules HEAD -- || i="+"
+ else
+ i="#"
+ fi
+ fi
+
if [ -n "${1-}" ]; then
- printf "$1" "${b##refs/heads/}$r"
+ printf "$1" "${b##refs/heads/}$w$i$r"
else
- printf " (%s)" "${b##refs/heads/}$r"
+ printf " (%s)" "${b##refs/heads/}$w$i$r"
fi
fi
}
--
tg: (7bbd8d6..) t/ps1-dirty-state (depends on: origin/master)
^ permalink raw reply related
* Re: Syncing with CVS
From: Robin Rosenberg @ 2009-01-19 22:05 UTC (permalink / raw)
To: Christian von Kietzell; +Cc: git
In-Reply-To: <f31e50960901190139w65b69fd1k752973a23c40f384@mail.gmail.com>
måndag 19 januari 2009 10:39:53 skrev Christian von Kietzell:
> Hi,
>
> I have a project I started in git. After a while I exported that to
> CVS via git cvsexportcommit which worked quite nicely. Now, a
> colleague made changes to the project - in CVS. What's the best way to
> get those back into my git repository so that I'll be able to sync
> back and forth between git and CVS? I had a quick look at the wiki but
> couldn't find anything appropriate.
>
> I know of git cvsimport, of course, but that doesn't work on my
> original repository. Or does it? I didn't find anything on how to
> limit what to import. After all, some of the commits are already in my
> repository (the ones I exported).
Just continue with cvsimport, then git rebase origin. That'll drop the
commits that you made when the same commit have been discovered
in CVS.
I personally do the cvs import into a separate repo using a cron job. That
extra repo is my origin so I get up-to-date using git fetch and rebase just
as if the CVS commits would come from a real repo.
-- robin
^ permalink raw reply
* [PATCH,v2] git-checkout(1): mention fate of extraneous files
From: jidanni @ 2009-01-19 22:45 UTC (permalink / raw)
To: gitster; +Cc: git, markus.heidelberg
In-Reply-To: <877i4teq78.fsf@jidanni.org>
Signed-off-by: jidanni <jidanni@jidanni.org>
---
Documentation/git-checkout.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 9cd5151..58abdc6 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -17,7 +17,8 @@ DESCRIPTION
When <paths> are not given, this command switches branches by
updating the index and working tree to reflect the specified
branch, <branch>, and updating HEAD to be <branch> or, if
-specified, <new_branch>. Using -b will cause <new_branch> to
+specified, <new_branch>. (No files are deleted, use linkgit:git-clean[1]
+for a pristine checkout.) Using -b will cause <new_branch> to
be created; in this case you can use the --track or --no-track
options, which will be passed to `git branch`.
--
1.6.0.6
^ permalink raw reply related
* [PATCH] commit: more compact summary and without extra quotes
From: Santi Béjar @ 2009-01-19 22:45 UTC (permalink / raw)
To: git
Original:
[master]: created d9a5491: "foo:bar"
While with the patch it becomes:
[master d9a5491] foo:bar
As discussed in the git mailing list:
http://marc.info/?l=git&m=122765031208922&w=2
Signed-off-by: Santi Béjar <santi@agolina.net>
---
builtin-commit.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 2f0b00a..b159af2 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -883,7 +883,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
{
struct rev_info rev;
struct commit *commit;
- static const char *format = "format:%h: \"%s\"";
+ static const char *format = "format:%h] %s";
unsigned char junk_sha1[20];
const char *head = resolve_ref("HEAD", junk_sha1, 0, NULL);
@@ -910,7 +910,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
rev.diffopt.break_opt = 0;
diff_setup_done(&rev.diffopt);
- printf("[%s%s]: created ",
+ printf("[%s%s ",
!prefixcmp(head, "refs/heads/") ?
head + 11 :
!strcmp(head, "HEAD") ?
--
1.6.1.258.g7ff14
^ permalink raw reply related
* Re: [PATCH v4 0/7] customizable --color-words
From: Santi Béjar @ 2009-01-19 22:47 UTC (permalink / raw)
To: Thomas Rast
Cc: git, Junio C Hamano, Johannes Schindelin, Boyd Stephen Smith Jr.,
Teemu Likonen
In-Reply-To: <1232209788-10408-1-git-send-email-trast@student.ethz.ch>
2009/1/17 Thomas Rast <trast@student.ethz.ch>:
> Johannes Schindelin (4):
> Add color_fwrite_lines(), a function coloring each line individually
> color-words: refactor word splitting and use ALLOC_GROW()
> color-words: change algorithm to allow for 0-character word
> boundaries
> color-words: take an optional regular expression describing words
>
> Thomas Rast (3):
> color-words: enable REG_NEWLINE to help user
> color-words: expand docs with precise semantics
> color-words: make regex configurable via attributes
>
Also, having a config (diff.color-words?) to set the default regexp
would be great. Thanks.
Santi
^ permalink raw reply
* [StGit PATCH] Added basic bash completion script for StGit.
From: ted @ 2009-01-19 22:57 UTC (permalink / raw)
To: catalin.marinas; +Cc: git, Ted Pavlic
From: Ted Pavlic <ted@tedpavlic.com>
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
---
contrib/completion/stg-completion.bash | 106 ++++++++++++++++++++++++++++++++
1 files changed, 106 insertions(+), 0 deletions(-)
create mode 100755 contrib/completion/stg-completion.bash
diff --git a/contrib/completion/stg-completion.bash b/contrib/completion/stg-completion.bash
new file mode 100755
index 0000000..13cc792
--- /dev/null
+++ b/contrib/completion/stg-completion.bash
@@ -0,0 +1,106 @@
+#!bash
+#
+# bash completion support for Stacked Git (StGit).
+#
+# Copyright (c) 2009 by Theodore P. Pavlic <ted@tedpavlic.com>
+# Distributed under the GNU General Public License, version 2.0.
+#
+# Design is highly influenced by completion scripts for Mercurial and
+# git.
+#
+# To use these routines:
+#
+# 1) Copy this file to somewhere (e.g. ~/.stg-completion.sh).
+# 2) Added the following line to your .bashrc or .bash_profile:
+# source ~/.stg-completion.sh
+#
+# To submit patches:
+#
+# *) Read Documentation/SubmittingPatches
+# *) Send all patches to the Git mailing list
+#
+# git@vger.kernel.org
+#
+# and CC the message to the StGit maintainer
+#
+# catalin.marinas@gmail.com
+#
+# Prefix the subject with something like "[StGit PATCH]",
+# "[StGit PATCH i/n]", "[StGit PATCH RFC]", or similar. Patches
+# should be "Signed-off-by:" you as described in
+# Documentation/SubmittingPatches.
+#
+# It is recommended that editors submit patches using utilities
+# like
+#
+# stg mail
+# git send-email
+# git format-patch
+#
+# In the latter case, make sure e-amils submitted to the list do
+# not have "format=flowed" and do not "word wrap" your patch.
+#
+
+# This 'extglob' bash option allows for
+# if [[ $param == @(-h|--help) ]]
+# type statements. That is, the pattern is true if $param matches -h OR
+# --help
+shopt -s extglob
+
+__stg_commands()
+{
+ local commands
+ commands="$("$stg" help|grep '^ '|cut -f3 -d' ' 2>/dev/null)" || commands=""
+ COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$commands' -- "$cur"))
+}
+
+__stg()
+{
+ local cur prev cmd
+ local stg="$1"
+
+ COMPREPLY=()
+ cur="$2"
+ prev="$3"
+
+ if [ $COMP_CWORD -gt 1 ]; then
+ # Try to complete the argument to an already complete stg command
+ # (e.g., "stg command partial<tab>")
+ cmd=${COMP_WORDS[${COMP_CWORD}-1]}
+ __stg_specific_command
+ else
+ # Try to complete an incomplete stg command (possibly blank)
+ # (e.g., "stg partial<tab>")
+ __stg_commands
+ fi
+
+}
+
+# Handle "stg command <tab>" completion
+__stg_specific_command()
+{
+ # Here, try to find (possibly user-defined) functions that match the
+ # command
+ if [ "$(type -t "__stg_cmd_$cmd")" = function ]; then
+ "__stg_cmd_$cmd"
+ return 0
+ fi
+
+ # Special handling of particular stg commands can be placed here
+ case "$cmd" in
+ help)
+ # Complete help with all possible help commands
+ __stg_commands
+ ;;
+ *)
+ # Bail out to normal bash completion
+ return 1
+ ;;
+ esac
+
+ return 0
+}
+
+# Use __stg for stg completion and bail out to normal bash completion
+complete -o bashdefault -o default -F __stg stg 2>/dev/null \
+ || complete -o default -F __stg stg
--
1.6.1.87.g15624
^ permalink raw reply related
* Re: [PATCH 2/2] expand --pretty=format color options
From: Junio C Hamano @ 2009-01-19 23:10 UTC (permalink / raw)
To: Jeff King; +Cc: René Scharfe, Markus Heidelberg, git
In-Reply-To: <20090118195342.GA612@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Hrm. OK, it doesn't actually work always. It does for git-log, but not
> for rev-list, which leaves diff_use_color_default as -1. I don't know if
> there are any other ways you can get to this code path without having
> set diff_use_color_default.
Yuck, no matter what you do please don't contaminate plumbing with the UI
color options.
> Maybe it is time to do a cleanup on the color handling, which has
> provided no end of these bugs. I will have to leave that for another
> day, though.
^ permalink raw reply
* Re: [StGit PATCH] Added basic bash completion script for StGit.
From: Ted Pavlic @ 2009-01-19 23:15 UTC (permalink / raw)
To: Ted Pavlic; +Cc: catalin.marinas, git
In-Reply-To: <1232405879-6188-1-git-send-email-ted@tedpavlic.com>
> +# Use __stg for stg completion and bail out to normal bash completion
> +complete -o bashdefault -o default -F __stg stg 2>/dev/null \
> + || complete -o default -F __stg stg
Somehow I didn't see the existing
stgit-completion.bash
in stgit.git. I was looking in stgit.git/contrib, which is where Git
(and Mercurial) puts its completion script.
So it looks like there's no need for this patch.
Thanks --
Ted
--
Ted Pavlic <ted@tedpavlic.com>
Please visit my ALS association page:
http://web.alsa.org/goto/tedpavlic
My family appreciates your support in the fight to defeat ALS.
^ permalink raw reply
* Re: [PATCH,v2] git-checkout(1): mention fate of extraneous files
From: Boyd Stephen Smith Jr. @ 2009-01-19 23:16 UTC (permalink / raw)
To: jidanni; +Cc: gitster, git, markus.heidelberg
In-Reply-To: <87priivrt3.fsf_-_@jidanni.org>
[-- Attachment #1: Type: text/plain, Size: 721 bytes --]
>-specified, <new_branch>. Using -b will cause <new_branch> to
>+specified, <new_branch>. (No files are deleted, use linkgit:git-clean[1]
>+for a pristine checkout.) Using -b will cause <new_branch> to
The parenthetical remark is not true, here:
$ git status
# On branch anagrams
nothing to commit (working directory clean)
$ ls
anagram fsdupfind
$ git checkout master
Switched to branch "master"
$ ls
fsdupfind
I think you mean "No untracked content is removed,...".
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH,v3] git-checkout(1): mention fate of extraneous files
From: jidanni @ 2009-01-19 23:31 UTC (permalink / raw)
To: bss; +Cc: gitster, git, markus.heidelberg
In-Reply-To: <200901191716.59373.bss@iguanasuicide.net>
Signed-off-by: jidanni <jidanni@jidanni.org>
---
Thanks Boyd.
Documentation/git-checkout.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 9cd5151..56e1ec9 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -17,7 +17,8 @@ DESCRIPTION
When <paths> are not given, this command switches branches by
updating the index and working tree to reflect the specified
branch, <branch>, and updating HEAD to be <branch> or, if
-specified, <new_branch>. Using -b will cause <new_branch> to
+specified, <new_branch>. (To also delete untracked content
+use linkgit:git-clean[1].) Using -b will cause <new_branch> to
be created; in this case you can use the --track or --no-track
options, which will be passed to `git branch`.
--
1.6.0.6
^ permalink raw reply related
* Re: [StGit PATCH] Added basic bash completion script for StGit.
From: Ted Pavlic @ 2009-01-19 23:35 UTC (permalink / raw)
To: Ted Pavlic; +Cc: catalin.marinas, git
In-Reply-To: <497509A2.5020101@tedpavlic.com>
>> +# Use __stg for stg completion and bail out to normal bash completion
>> +complete -o bashdefault -o default -F __stg stg 2>/dev/null \
>> + || complete -o default -F __stg stg
>
> Somehow I didn't see the existing
>
> stgit-completion.bash
I didn't see it because it is generated in the build process. :(
Sorry for the bother --
Ted
--
Ted Pavlic <ted@tedpavlic.com>
Please visit my ALS association page:
http://web.alsa.org/goto/tedpavlic
My family appreciates your support in the fight to defeat ALS.
^ permalink raw reply
* Re: [PATCH v4 0/7] customizable --color-words
From: Johannes Schindelin @ 2009-01-19 23:35 UTC (permalink / raw)
To: Santi Béjar
Cc: Thomas Rast, git, Junio C Hamano, Boyd Stephen Smith Jr.,
Teemu Likonen
In-Reply-To: <adf1fd3d0901191447n7fc39dect9cf5afd88a02015b@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1310 bytes --]
Hi,
On Mon, 19 Jan 2009, Santi Béjar wrote:
> 2009/1/17 Thomas Rast <trast@student.ethz.ch>:
> > Johannes Schindelin (4):
> > Add color_fwrite_lines(), a function coloring each line individually
> > color-words: refactor word splitting and use ALLOC_GROW()
> > color-words: change algorithm to allow for 0-character word
> > boundaries
> > color-words: take an optional regular expression describing words
> >
> > Thomas Rast (3):
> > color-words: enable REG_NEWLINE to help user
> > color-words: expand docs with precise semantics
> > color-words: make regex configurable via attributes
> >
>
> Also, having a config (diff.color-words?) to set the default regexp
> would be great. Thanks.
>From "git log --author==Santi --stat" it seems that you are quite capable
of providing that patch.
A few pointers:
- Add a global variable to diff.c, maybe "char *diff_word_regex".
(Maybe it should be static instead, as it will be used in diff.c only.)
- Add code to set it in diff.c, function git_diff_ui_config().
- In diff.c, where "--color-words" is handled (without "="), add
if (diff_words_regex)
options->word_regex = diff_word_regex;
- Add a test to t4034 that tests that the config sets a default, and that
the command line can override it.
- Send to this list :-)
Ciao,
Dscho
^ permalink raw reply
* [PATCH] contrib/difftool: change trap condition from SIGINT to INT
From: Markus Heidelberg @ 2009-01-19 23:38 UTC (permalink / raw)
To: David Aguilar; +Cc: Junio C Hamano, git
git-difftool worked for me on an up-to-date Gentoo Linux at home, but
didn't work on a somewhat older Ubuntu Linux 7.10 at work and failed
with the following error, where 'Makefile' was locally modified:
trap: 244: SIGINT: bad trap
external diff died, stopping at Makefile.
In 'man 1p trap' there is written:
"The condition can be EXIT, 0 (equivalent to EXIT), or a signal
specified using a symbolic name, without the SIG prefix, [...]"
"Implementations may permit names with the SIG prefix or ignore case
in signal names as an extension."
So now we do it the POSIX compliant way instead of using an extension.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
contrib/difftool/git-difftool-helper | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper
index f013726..a2eb59b 100755
--- a/contrib/difftool/git-difftool-helper
+++ b/contrib/difftool/git-difftool-helper
@@ -53,7 +53,7 @@ launch_merge_tool () {
# Create and ensure that we clean up $BACKUP
test -f "$MERGED" && cp -- "$MERGED" "$BACKUP"
- trap sigint_handler SIGINT
+ trap sigint_handler INT
# $LOCAL and $REMOTE are temporary files so prompt
# the user with the real $MERGED name before launching $merge_tool.
--
1.6.1.216.g3acd
^ permalink raw reply related
* Re: [PATCH] Provide pessimistic defaults for cross compilation tests.
From: Johannes Schindelin @ 2009-01-19 23:39 UTC (permalink / raw)
To: Ralf Wildenhues; +Cc: Julius Naperkowski, git
In-Reply-To: <20090119203400.GA3539@ins.uni-bonn.de>
Hi,
On Mon, 19 Jan 2009, Ralf Wildenhues wrote:
> In a cross compile setup, configure tests that run programs
> cannot be executed; in that case, provide pessimistic default
> values.
You may want to note in the subject that this patch is about configure.
How do you deal with the hardcoded limitation that uname_S is defined to
be the output of "uname -s" on the _build_ system, and that quite a large
part of the Makefile sets variables dependent on this?
IOW are you certain that configure (with your patch) will override _all_
uname_S dependent settings?
Ciao,
Dscho
^ permalink raw reply
* [PATCH] contrib/difftool: remove distracting 'echo' in the SIGINT handler
From: Markus Heidelberg @ 2009-01-19 23:41 UTC (permalink / raw)
To: David Aguilar; +Cc: Junio C Hamano, git
When interrupting git-difftool with Ctrl-C, the output of this echo
command led to having the cursor at the beginning of the line below the
shell prompt.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
David, have you intentionally added this 'echo', did it fix
anything for you?
contrib/difftool/git-difftool-helper | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper
index a2eb59b..0c48506 100755
--- a/contrib/difftool/git-difftool-helper
+++ b/contrib/difftool/git-difftool-helper
@@ -32,7 +32,6 @@ cleanup_temp_files () {
# This is called when users Ctrl-C out of git-difftool-helper
sigint_handler () {
- echo
cleanup_temp_files
exit 1
}
--
1.6.1.216.g3acd
^ permalink raw reply related
* Re: [PATCH,v2] git-checkout(1): mention fate of extraneous files
From: Johannes Schindelin @ 2009-01-19 23:42 UTC (permalink / raw)
To: Boyd Stephen Smith Jr.; +Cc: jidanni, gitster, git, markus.heidelberg
In-Reply-To: <200901191716.59373.bss@iguanasuicide.net>
Hi,
On Mon, 19 Jan 2009, Boyd Stephen Smith Jr. wrote:
> I think you mean "No untracked content is removed,...".
As "checkout" is about switching branches, and as Git is very keen on
avoiding loss of uncommitted changes, I think this comment is utterly
unnecessary. Indeed, it is rather annoying: when I read a document the
other day, that I _had_ to read, and which was full of obvious statements,
sure enough, I missed the single important half-sentence.
IOW do not clutter the man page with distracting stuff, please, please,
please.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] use uppercase POSIX compliant signals for the 'trap' command
From: Markus Heidelberg @ 2009-01-19 23:43 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In 'man 1p trap' there is written:
"Implementations may permit names with the SIG prefix or ignore case
in signal names as an extension."
So change the lowercase signals to uppercase, which is POSIX compliant
instead of being an extension.
There wasn't anybody claiming that it doesn't work, but there was a bug
with using a signal with the SIG prefix, which is an extension as well.
So let's play it safe and change it, since it doesn't hurt anyone.
While at it, also convert 8 indentation spaces to 1 tab character.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
t/lib-httpd.sh | 10 +++++-----
t/test-lib.sh | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 6ac312b..3824020 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -20,9 +20,9 @@ HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www
if ! test -x "$LIB_HTTPD_PATH"
then
- say "skipping test, no web server found at '$LIB_HTTPD_PATH'"
- test_done
- exit
+ say "skipping test, no web server found at '$LIB_HTTPD_PATH'"
+ test_done
+ exit
fi
HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \
@@ -84,7 +84,7 @@ prepare_httpd() {
start_httpd() {
prepare_httpd
- trap 'stop_httpd; die' exit
+ trap 'stop_httpd; die' EXIT
"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
-f "$TEST_PATH/apache.conf" $HTTPD_PARA \
@@ -92,7 +92,7 @@ start_httpd() {
}
stop_httpd() {
- trap 'die' exit
+ trap 'die' EXIT
"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
-f "$TEST_PATH/apache.conf" -k stop
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 22ed448..41d5a59 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -127,7 +127,7 @@ fi
error () {
say_color error "error: $*"
- trap - exit
+ trap - EXIT
exit 1
}
@@ -163,7 +163,7 @@ die () {
exit 1
}
-trap 'die' exit
+trap 'die' EXIT
# The semantics of the editor variables are that of invoking
# sh -c "$EDITOR \"$@\"" files ...
@@ -208,7 +208,7 @@ test_failure_ () {
say_color error "FAIL $test_count: $1"
shift
echo "$@" | sed -e 's/^/ /'
- test "$immediate" = "" || { trap - exit; exit 1; }
+ test "$immediate" = "" || { trap - EXIT; exit 1; }
}
test_known_broken_ok_ () {
@@ -416,7 +416,7 @@ test_create_repo () {
}
test_done () {
- trap - exit
+ trap - EXIT
test_results_dir="$TEST_DIRECTORY/test-results"
mkdir -p "$test_results_dir"
test_results_path="$test_results_dir/${0%-*}-$$"
@@ -493,7 +493,7 @@ fi
test="trash directory.$(basename "$0" .sh)"
test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
rm -fr "$test" || {
- trap - exit
+ trap - EXIT
echo >&5 "FATAL: Cannot prepare test area"
exit 1
}
--
1.6.1.216.g3acd
^ permalink raw reply related
* Re: [PATCH] commit: more compact summary and without extra quotes
From: Johannes Schindelin @ 2009-01-19 23:46 UTC (permalink / raw)
To: Santi Béjar; +Cc: git
In-Reply-To: <1232405116-2359-1-git-send-email-santi@agolina.net>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 645 bytes --]
Hi,
On Mon, 19 Jan 2009, Santi Béjar wrote:
> Original:
> [master]: created d9a5491: "foo:bar"
>
> While with the patch it becomes:
> [master d9a5491] foo:bar
Maybe you want to mention that it saves screen estate. After all, the
commit message is _the_ place to relate your motivation to the gentle
reader.
> As discussed in the git mailing list:
>
> http://marc.info/?l=git&m=122765031208922&w=2
>
> Signed-off-by: Santi Béjar <santi@agolina.net>
> ---
You really want to move the link after the ---. I often read commit
messages off-line, and let me tell you: I am not really happy reading
links then. Not at all.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] contrib: add 'git bpush' to push to bundles
From: Santi Béjar @ 2009-01-19 23:46 UTC (permalink / raw)
To: git
'git bpush' updates the branches in a bundle, while adding the objects
necessary to complete the given branches. Basically, it is a 'git push'
for bundles.
Signed-off-by: Santi Béjar <santi@agolina.net>
---
contrib/bpush/git-bpush | 195 ++++++++++++++++++++++++++++++++++++
contrib/bpush/git-bpush.txt | 68 +++++++++++++
contrib/bpush/t5519-bundle-push.sh | 193 +++++++++++++++++++++++++++++++++++
contrib/bpush/t5519/expect.10 | 4 +
contrib/bpush/t5519/expect.11 | 4 +
contrib/bpush/t5519/expect.12 | 7 ++
contrib/bpush/t5519/expect.13 | 4 +
contrib/bpush/t5519/expect.14 | 4 +
contrib/bpush/t5519/expect.15 | 4 +
contrib/bpush/t5519/expect.16 | 4 +
contrib/bpush/t5519/expect.17 | 5 +
contrib/bpush/t5519/expect.18 | 6 +
contrib/bpush/t5519/expect.19 | 6 +
contrib/bpush/t5519/expect.2 | 4 +
contrib/bpush/t5519/expect.3 | 3 +
contrib/bpush/t5519/expect.4 | 4 +
contrib/bpush/t5519/expect.5 | 5 +
contrib/bpush/t5519/expect.6 | 5 +
contrib/bpush/t5519/expect.7 | 5 +
contrib/bpush/t5519/expect.8 | 5 +
contrib/bpush/t5519/expect.9 | 4 +
21 files changed, 539 insertions(+), 0 deletions(-)
create mode 100755 contrib/bpush/git-bpush
create mode 100644 contrib/bpush/git-bpush.txt
create mode 100755 contrib/bpush/t5519-bundle-push.sh
create mode 100644 contrib/bpush/t5519/expect.10
create mode 100644 contrib/bpush/t5519/expect.11
create mode 100644 contrib/bpush/t5519/expect.12
create mode 100644 contrib/bpush/t5519/expect.13
create mode 100644 contrib/bpush/t5519/expect.14
create mode 100644 contrib/bpush/t5519/expect.15
create mode 100644 contrib/bpush/t5519/expect.16
create mode 100644 contrib/bpush/t5519/expect.17
create mode 100644 contrib/bpush/t5519/expect.18
create mode 100644 contrib/bpush/t5519/expect.19
create mode 100644 contrib/bpush/t5519/expect.2
create mode 100644 contrib/bpush/t5519/expect.3
create mode 100644 contrib/bpush/t5519/expect.4
create mode 100644 contrib/bpush/t5519/expect.5
create mode 100644 contrib/bpush/t5519/expect.6
create mode 100644 contrib/bpush/t5519/expect.7
create mode 100644 contrib/bpush/t5519/expect.8
create mode 100644 contrib/bpush/t5519/expect.9
diff --git a/contrib/bpush/git-bpush b/contrib/bpush/git-bpush
new file mode 100755
index 0000000..a004c42
--- /dev/null
+++ b/contrib/bpush/git-bpush
@@ -0,0 +1,195 @@
+#!/bin/sh
+
+OPTIONS_KEEPDASHDASH=
+OPTIONS_SPEC="\
+git bpush [options] [<remote> [<refs>...]]
+--
+f,force force updates
+full create a full bundle
+v be verbose
+"
+SUBDIRECTORY_OK=Yes
+. git-sh-setup
+. git-parse-remote
+
+cd_to_toplevel
+
+LF='
+'
+IFS="$LF"
+
+bases=
+bbases=
+changed=
+force=
+nonff=
+remote=
+refs=
+while :
+do
+ case "$1" in
+ -v)
+ verbose=t ;;
+ --full)
+ full=t ;;
+ -f|--force)
+ force=t ;;
+ --)
+ shift
+ break ;;
+ *)
+ usage ;;
+ esac
+ shift
+done
+
+test -n "$1" && remote=$1 && shift
+refs="$*"
+
+test -z "$remote" && remote=$(get_default_remote)
+remoteurl=$(git config remote.${remote}.url)
+test -z "$remoteurl" && remoteurl=$remote
+test -d "$remoteurl" && die "$remoteurl is a directory"
+
+# Default bases in bundle.base
+# Default {refs,base} can be specified in remote.<remote>.{push,bundlebase}
+if test "$remote" != "$remoteurl"
+then
+ test -z "$refs" &&
+ refs=$(git config --get-all remote.${remote}.push)
+ bases=$(git config --get-all remote.${remote}.bundlebase ||
+ git config --get-all bundle.base)
+else
+ bases=$(git config --get-all bundle.base)
+fi
+
+# git rev-parse --symbolic-full-name resolves symlinks
+# Keep at least HEAD
+head=
+for ref in $refs ; do
+ test "$ref" = HEAD && head=t && break
+done
+
+test -n "$bases" && bases=$(git rev-parse --revs-only $bases | sort -u)
+
+# Full symbolic refs need to be uniq
+test -n "$refs" &&
+refs=$(git-rev-parse --symbolic-full-name --revs-only $refs | sort -u)
+
+test -n "$head" && refs="HEAD$LF$refs"
+
+if test -e "$remoteurl"
+then
+ blines=$(git bundle verify "$remoteurl" 2>/dev/null) ||
+ die "Verification of \"$remoteurl\" failed"
+ # Find the bundle's bases
+ refs="$refs$LF$(git bundle list-heads $remoteurl | cut -d " " -f 2)"
+ requires=
+ for line in $blines
+ do
+ case "$requires,$line" in
+ ",The bundle requires"*)
+ requires=t ;;
+ t,) ;;
+ t,*)
+ bbase=$(echo $line | cut -d " " -f 1)
+ bbases="$bbases$LF$bbase"
+ ;;
+ esac
+ done
+ bases="$bases$LF$bbases"
+elif test -z "$refs" ; then
+ # Push current branch
+ refs="HEAD$LF$(git symbolic-ref -q HEAD)"
+fi
+
+test -z "$refs" && die "No refs to push"
+
+refs=$(echo "$refs" | sort -u)
+
+for ref in $bases $refs
+do
+ test "$(git cat-file -t $ref^{})" != commit &&
+ die "$(basename $0): $ref is not a commit"
+done
+
+header="To $remoteurl"
+test -n "$verbose" && echo "Pushing to $remoteurl" && echo $header && header=
+
+# Find what is/is not a fast-forward, up to date or new
+# As "git bundle" does not support refspecs we must push all matching branches
+for ref in $refs ; do
+ text=
+ bchanged=
+ case $ref in
+ refs/tags/*)
+ bshort=$(echo $ref | sed -e "s|^refs/tags/||")
+ newtext="new tag";;
+ refs/heads/*|HEAD)
+ bshort=$(echo $ref | sed -e "s|^refs/heads/||")
+ newtext="new branch" ;;
+ esac
+ newhash=$(git rev-parse $ref) || die "Ref $ref not valid"
+ newshort=$(git rev-parse --short $ref)
+ bheads=
+ test -e "$remoteurl" && bheads="$(git bundle list-heads $remoteurl)"
+ for bhead in $bheads
+ do
+ bhash=$(echo $bhead | cut -d " " -f 1)
+ bref=$(echo $bhead | cut -d " " -f 2)
+ # Find the matching ref in the bundle
+ test "$bref" != "$ref" && continue
+ oldshort=$(git rev-parse --short $bhash)
+ mergebase=
+ case $ref in
+ refs/tags/*)
+ # Only test if it is different
+ mergebase=$newhash;;
+ refs/heads/*|HEAD)
+ mergebase=$(git merge-base $bref $bhash);;
+ esac
+ case $newhash,$bhash,$mergebase,$force in
+ $bhash,$newhash,*)
+ # No changes
+ text=" = [up to date] $bshort -> $bshort"
+ ;;
+ *,*,$bhash,*)
+ # Fast-forward
+ bchanged=t
+ text=" $oldshort..$newshort $bshort -> $bshort"
+ ;;
+ *,t)
+ # Forced non fast-forward
+ bchanged=t
+ text=" + $oldshort...$newshort $bshort -> $bshort (forced update)"
+ ;;
+ *)
+ bchanged=t
+ nonff=t
+ text=" ! [rejected] $bshort -> $bshort (non-fast forward)"
+ esac
+ break
+ done
+ test -z "$text" && text=" * [$newtext] $bshort -> $bshort" && bchanged=t
+ if test -n "$bchanged" || test -n "$verbose"
+ then
+ test -n "$header" && echo $header && header=
+ echo $text
+ fi
+ test -n "$bchanged" && changed=t
+done
+
+# Recreate the bundle if --full and the current bundle is not full
+test -n "$full" && bases= && test -n "$bbases" && changed=t
+
+test -n "$nonff" && die "error: failed to push some refs to $remoteurl"
+test -z "$changed" && die "Everything up-to-date"
+test -n "$bases" && bases="--not$LF$bases"
+
+git bundle create $remoteurl $refs $bases ||
+die "Cannot create bundle \"$remoteurl\""
+
+test "$remote" != "$remoteurl" && { git fetch -q "$remote" ||
+ die "Error fetch from bundle \"$remoteurl\"" ; }
+
+exit 0
diff --git a/contrib/bpush/git-bpush.txt b/contrib/bpush/git-bpush.txt
new file mode 100644
index 0000000..a045c91
--- /dev/null
+++ b/contrib/bpush/git-bpush.txt
@@ -0,0 +1,68 @@
+git-bpush(1)
+============
+
+NAME
+----
+git-bpush - Update bundles along with associated objects
+
+SYNOPSIS
+--------
+[verse]
+'git bpush' [--full] [--force] [<bundle> <refs>...]
+
+DESCRIPTION
+-----------
+
+'git bpush' updates the branches in a bundle, while adding the objects
+necessary to complete the given branches. Basically, it is a 'git push'
+for bundles.
+
+By default, if the bundle does not exist a full bundle is create with the
+current branch, and if it does exist it updates all the branches in it
+appending all the needed objects.
+
+OPTIONS
+-------
+<bundle>::
+ Equal to the <repository> parameter of 'git push' but pointing
+ to a local path.
+
+<refs>::
+ A list of branches to push
+
+--full::
+ Create a bundle with all the needed object even if the existing
+ bundle is not full.
+
+--force::
+ Equivalent to the '--force' flag to 'git push'.
+
+CONFIG VARIABLES
+----------------
+branch.<name>.remote::
+remote.<name>.url::
+remote.<name>.push::
+ With the same meaning but the URL should be a local path and the
+ 'push' config should list only branches, not refspecs.
+
+remote.<name>.bundlebase::
+bundle.base::
+ Default base to create a new bundle (per remote or global).
+
+SEE ALSO
+--------
+linkgit:git-diff[1]
+
+linkgit:git-config[1]
+
+AUTHOR
+------
+Written by Santi Béjar <santi@agolina.net>.
+
+Documentation
+--------------
+Documentation by Santi Béjar.
+
+GIT
+---
+Part of the contrib section of the linkgit:git[1] suite
diff --git a/contrib/bpush/t5519-bundle-push.sh b/contrib/bpush/t5519-bundle-push.sh
new file mode 100755
index 0000000..464f32f
--- /dev/null
+++ b/contrib/bpush/t5519-bundle-push.sh
@@ -0,0 +1,193 @@
+#!/bin/sh
+
+test_description='Bundle pushing'
+
+. ./test-lib.sh
+
+other=
+
+mk_test () {
+ num=$(( $num + 1 )) &&
+ actual=actual.$num &&
+ expect="$TEST_DIRECTORY"/t5519/expect.$num &&
+ expect_other="$TEST_DIRECTORY"/t5519/expect.$other &&
+ git bundle verify b.bundle > "$actual" &&
+ if test -f "$expect"
+ then
+ if [ -n "$other" ] ; then
+ test_cmp "$expect_other" "$actual"
+ else
+ true
+ fi &&
+ test_cmp "$expect" "$actual" &&
+ rm -f "$actual"
+ else
+ # this is to help developing new tests.
+ cp "$actual" "$expect"
+ false
+ fi
+}
+
+test_expect_success setup '
+
+ : >path1 &&
+ git add path1 &&
+ test_tick &&
+ git commit -a -m repo &&
+ the_first_commit=$(git show-ref -s --verify refs/heads/master) &&
+ git branch b1 &&
+ git tag t1 &&
+
+ : >path2 &&
+ git add path2 &&
+ test_tick &&
+ git commit -a -m second &&
+ the_second_commit=$(git show-ref -s --verify refs/heads/master) &&
+ git branch b2 &&
+ git tag t2 &&
+
+ : >path3 &&
+ git add path3 &&
+ test_tick &&
+ git commit -a -m third &&
+ the_third_commit=$(git show-ref -s --verify refs/heads/master) &&
+ git branch b3 &&
+ git tag t3 &&
+
+ git reset --hard b2 &&
+ : >path4 &&
+ git add path4 &&
+ test_tick &&
+ git commit -a -m fourth &&
+ the_fourth_commit=$(git show-ref -s --verify refs/heads/master) &&
+ git branch b4 &&
+ git tag t4 &&
+
+ num=1
+'
+
+test_expect_success 'full bundle' '
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'full bundle with 1 branch' '
+ rm b.bundle &&
+ git bpush b.bundle b2 &&
+ mk_test
+'
+
+test_expect_success 'full bundle with 2 branches' '
+ rm b.bundle &&
+ git bpush b.bundle b2 master &&
+ mk_test
+'
+
+test_expect_success 'bundle with 1 commit as base' '
+ rm b.bundle &&
+ git config bundle.base $the_first_commit
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'bundle with 1 branch as base' '
+ rm b.bundle &&
+ other=$num &&
+ git config bundle.base b1
+ git bpush b.bundle &&
+ mk_test
+'
+test_expect_success 'bundle with 1 tag as base' '
+ rm b.bundle &&
+ git config bundle.base t1
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'bundle with 1 sha1 expression as base' '
+ rm b.bundle &&
+ git config bundle.base t2^
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'Force a full bundle' '
+ git bpush --full b.bundle &&
+ other=2 &&
+ mk_test
+
+'
+unset other
+git config --unset bundle.base
+
+test_expect_success 'updating bundle: initial' '
+ rm b.bundle &&
+ git reset --hard b1 &&
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'updating bundle: update' '
+ git reset --hard b2 &&
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'updating bundle with extra branches' '
+ git bpush b.bundle b2 b3 b4 &&
+ mk_test
+'
+
+test_expect_success 'Deny non fast forward: initial' '
+ rm b.bundle &&
+ git reset --hard b3 &&
+ git bpush b.bundle &&
+ mk_test
+'
+
+test_expect_success 'Deny non fast-fordard: denied' '
+ git reset --hard b4 &&
+ test_must_fail git bpush b.bundle &&
+ other=$num &&
+ mk_test
+'
+
+test_expect_success 'Deny non fast-fordard: force' '
+ git bpush --force b.bundle &&
+ other=2
+ mk_test
+'
+
+git config remote.b.url b.bundle
+
+test_expect_success 'pushing to a <remote>' '
+ rm b.bundle &&
+ git bpush b &&
+ other=2
+ mk_test
+'
+
+unset other
+
+test_expect_success 'remote with remote.<remote>.push' '
+ git config remote.b.push b4 &&
+ git bpush b &&
+ mk_test
+'
+
+test_expect_success 'remote with multiple remote.<remote>.push' '
+ git config --add remote.b.push b3 &&
+ git bpush b &&
+ mk_test
+'
+
+test_expect_success 'cancel bases in remote.<remote>.bundlebase' '
+ rm b.bundle &&
+ git config --add remote.b.push HEAD &&
+ git config remote.b.bundlebase "" &&
+ git config bundle.base t1 &&
+ git bpush b &&
+ mk_test
+'
+
+test_done
diff --git a/contrib/bpush/t5519/expect.10 b/contrib/bpush/t5519/expect.10
new file mode 100644
index 0000000..f16f35f
--- /dev/null
+++ b/contrib/bpush/t5519/expect.10
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+b9c09d6cc74d3857142fb7c082dca65b88254c6d HEAD
+b9c09d6cc74d3857142fb7c082dca65b88254c6d refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.11 b/contrib/bpush/t5519/expect.11
new file mode 100644
index 0000000..23b288f
--- /dev/null
+++ b/contrib/bpush/t5519/expect.11
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f HEAD
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.12 b/contrib/bpush/t5519/expect.12
new file mode 100644
index 0000000..583c759
--- /dev/null
+++ b/contrib/bpush/t5519/expect.12
@@ -0,0 +1,7 @@
+The bundle contains 5 refs
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f HEAD
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f refs/heads/b2
+0c61b881205ba69f6b78d3fdd45db054d236eea8 refs/heads/b3
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/b4
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.13 b/contrib/bpush/t5519/expect.13
new file mode 100644
index 0000000..fb1c2a7
--- /dev/null
+++ b/contrib/bpush/t5519/expect.13
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+0c61b881205ba69f6b78d3fdd45db054d236eea8 HEAD
+0c61b881205ba69f6b78d3fdd45db054d236eea8 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.14 b/contrib/bpush/t5519/expect.14
new file mode 100644
index 0000000..fb1c2a7
--- /dev/null
+++ b/contrib/bpush/t5519/expect.14
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+0c61b881205ba69f6b78d3fdd45db054d236eea8 HEAD
+0c61b881205ba69f6b78d3fdd45db054d236eea8 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.15 b/contrib/bpush/t5519/expect.15
new file mode 100644
index 0000000..9047296
--- /dev/null
+++ b/contrib/bpush/t5519/expect.15
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.16 b/contrib/bpush/t5519/expect.16
new file mode 100644
index 0000000..9047296
--- /dev/null
+++ b/contrib/bpush/t5519/expect.16
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.17 b/contrib/bpush/t5519/expect.17
new file mode 100644
index 0000000..14c8713
--- /dev/null
+++ b/contrib/bpush/t5519/expect.17
@@ -0,0 +1,5 @@
+The bundle contains 3 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/b4
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.18 b/contrib/bpush/t5519/expect.18
new file mode 100644
index 0000000..dd8682b
--- /dev/null
+++ b/contrib/bpush/t5519/expect.18
@@ -0,0 +1,6 @@
+The bundle contains 4 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+0c61b881205ba69f6b78d3fdd45db054d236eea8 refs/heads/b3
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/b4
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.19 b/contrib/bpush/t5519/expect.19
new file mode 100644
index 0000000..dd8682b
--- /dev/null
+++ b/contrib/bpush/t5519/expect.19
@@ -0,0 +1,6 @@
+The bundle contains 4 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+0c61b881205ba69f6b78d3fdd45db054d236eea8 refs/heads/b3
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/b4
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.2 b/contrib/bpush/t5519/expect.2
new file mode 100644
index 0000000..9047296
--- /dev/null
+++ b/contrib/bpush/t5519/expect.2
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.3 b/contrib/bpush/t5519/expect.3
new file mode 100644
index 0000000..3b476c7
--- /dev/null
+++ b/contrib/bpush/t5519/expect.3
@@ -0,0 +1,3 @@
+The bundle contains 1 ref
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f refs/heads/b2
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.4 b/contrib/bpush/t5519/expect.4
new file mode 100644
index 0000000..59c144c
--- /dev/null
+++ b/contrib/bpush/t5519/expect.4
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f refs/heads/b2
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
diff --git a/contrib/bpush/t5519/expect.5 b/contrib/bpush/t5519/expect.5
new file mode 100644
index 0000000..ba77351
--- /dev/null
+++ b/contrib/bpush/t5519/expect.5
@@ -0,0 +1,5 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 1 ref
+b9c09d6cc74d3857142fb7c082dca65b88254c6d repo
diff --git a/contrib/bpush/t5519/expect.6 b/contrib/bpush/t5519/expect.6
new file mode 100644
index 0000000..ba77351
--- /dev/null
+++ b/contrib/bpush/t5519/expect.6
@@ -0,0 +1,5 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 1 ref
+b9c09d6cc74d3857142fb7c082dca65b88254c6d repo
diff --git a/contrib/bpush/t5519/expect.7 b/contrib/bpush/t5519/expect.7
new file mode 100644
index 0000000..ba77351
--- /dev/null
+++ b/contrib/bpush/t5519/expect.7
@@ -0,0 +1,5 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 1 ref
+b9c09d6cc74d3857142fb7c082dca65b88254c6d repo
diff --git a/contrib/bpush/t5519/expect.8 b/contrib/bpush/t5519/expect.8
new file mode 100644
index 0000000..ba77351
--- /dev/null
+++ b/contrib/bpush/t5519/expect.8
@@ -0,0 +1,5 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 1 ref
+b9c09d6cc74d3857142fb7c082dca65b88254c6d repo
diff --git a/contrib/bpush/t5519/expect.9 b/contrib/bpush/t5519/expect.9
new file mode 100644
index 0000000..9047296
--- /dev/null
+++ b/contrib/bpush/t5519/expect.9
@@ -0,0 +1,4 @@
+The bundle contains 2 refs
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 HEAD
+2d4a0f4bd0a1c33802f2f3417f5a999dff37f9d7 refs/heads/master
+The bundle requires these 0 ref
--
1.6.1.258.g7ff14
^ permalink raw reply related
* An idea: maybe Git should use a lock/unlock file mode for problematic files? [Was: Re: after first git clone of linux kernel repository there are changed files in working dir]
From: thestar @ 2009-01-19 23:52 UTC (permalink / raw)
To: Hannu Koivisto; +Cc: rdkrsr, git
In-Reply-To: <83ocy3fmez.fsf@kalahari.s2.org>
Quoting Hannu Koivisto <azure@iki.fi>:
<snip>
> Kernel source contains pairs of files whose names differ only by
> case. Windows cannot store such pairs (at least by default) and
> apparently there is no support for such a situation in git so
> you'll only get one file from each pair to your workspace and the
> other file is shown as modified.
Could git be modified to allow such repositories to be used on windows
by locking files that are problematic, for example, a given repository
could have files 'AAA' and 'aAa'.
The one that correctly represents the on-disk file would be 'open for
edit', while the other file would be locked. To edit the other file,
the existing file would need to be locked, and then the other file
would then need to be open for edit.
This could even be extended to allow one to "open file AAA for edit as
aAa.v2', giving the file an alternate name.
Such a workflow would only need to be used for such files, and could
also be used when there are incompatible file names for that given
partition type.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox