* [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
* Re: [PATCH] commit: more compact summary and without extra quotes
From: Santi Béjar @ 2009-01-20 0:00 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0901200043400.3586@pacific.mpi-cbg.de>
2009/1/20 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> 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.
I thought it was enough with the "more compact" in the title line.
>
>> 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.
OK, less work for me :-)
Santi
^ permalink raw reply
* [PATCH,v4] git-checkout(1): mention fate of extraneous files
From: jidanni @ 2009-01-20 0:01 UTC (permalink / raw)
To: johannes.schindelin; +Cc: bss, gitster, git, markus.heidelberg
In-Reply-To: <alpine.DEB.1.00.0901200040550.3586@pacific.mpi-cbg.de>
Signed-off-by: jidanni <jidanni@jidanni.org>
---
OK thanks Johannes.
I'm still worried that there is no exact statement on the fate of the
various different classes of files, but OK, moving this to only a SEE ALSO.
Documentation/git-checkout.txt | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 9cd5151..6ffb783 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -246,6 +246,9 @@ $ edit frotz
$ git add frotz
------------
+SEE ALSO
+--------
+linkgit:git-clean[1]
Author
------
--
1.6.0.6
^ permalink raw reply related
* Re: [PATCH,v4] git-checkout(1): mention fate of extraneous files
From: Johannes Schindelin @ 2009-01-20 0:11 UTC (permalink / raw)
To: jidanni; +Cc: bss, gitster, git, markus.heidelberg
In-Reply-To: <878wp6voar.fsf_-_@jidanni.org>
Hi,
On Tue, 20 Jan 2009, jidanni@jidanni.org wrote:
> Signed-off-by: jidanni <jidanni@jidanni.org>
> ---
> OK thanks Johannes.
> I'm still worried that there is no exact statement on the fate of the
> various different classes of files, but OK, moving this to only a SEE ALSO.
You completely misread me. So I will say it out directly: I think no
patch is needed.
Hth,
Dscho
^ permalink raw reply
* Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice
From: Thomas Rast @ 2009-01-20 0:11 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git, Johannes Sixt, Johan Herland
In-Reply-To: <alpine.DEB.1.00.0901191331590.3586@pacific.mpi-cbg.de>
[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]
Johannes Schindelin wrote:
> > Junio C Hamano <gitster@pobox.com> writes:
> > > You can have quite a many reflog entries, but you typically won't recall
> > > which branch you were on after switching branches for more than several
> > > times.
>
> This, together with a removal of the hard-coded limit of 16 could be
> squashed with this patch:
You know, I'm quite puzzled as to why we had working code that could
read the reflog backwards earlier in this thread, but it got shot down
solely based on impact and line counts, and you now have to jump
through hoops to work around the lack of this exact functionality.
So how about I resurrect the part about for_each_reflog_ent() and
_backward(), without touching read_ref_at(). This would actually
avoid the worst (hard to check) part of the patch since the
refactoring of for_each_reflog_ent()'s error checking is quite trivial
and IMHO actually results in more readable code.
I'm just asking because I'm not particularly inclined to do it first
and get rejected _again_.
--
Thomas Rast
trast@{inf,student}.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH (topgit)] tg-patch: add support for generating patches against worktree and index
From: martin f krafft @ 2009-01-20 0:21 UTC (permalink / raw)
To: Kirill Smelkov, Petr Baudis, Git Mailing List
In-Reply-To: <20090118150637.GC27522@roro3.zxlink>
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
also sprach Kirill Smelkov <kirr@landau.phys.spbu.ru> [2009.01.19.0206 +1100]:
> I don't understand why this gets ignored. Maybe I do something wrong?
I am not ignoring it, I am just currently flooded and travelling.
I don't see any obvious problems with your patch, but I do not have
the time to test it right now. I will do my best to do another
release when I return from Tasmania, hopefully on the plane trip
home. Maybe Petr can get around to it before I do.
Cheers, and sorry,
--
martin | http://madduck.net/ | http://two.sentenc.es/
if you find a spelling mistake in the above, you get to keep it.
spamtraps: madduck.bogus@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice
From: Johannes Schindelin @ 2009-01-20 0:23 UTC (permalink / raw)
To: Thomas Rast; +Cc: Junio C Hamano, git, Johannes Sixt, Johan Herland
In-Reply-To: <200901200111.38917.trast@student.ethz.ch>
Hi,
On Tue, 20 Jan 2009, Thomas Rast wrote:
> Johannes Schindelin wrote:
> > > Junio C Hamano <gitster@pobox.com> writes:
> > > > You can have quite a many reflog entries, but you typically won't recall
> > > > which branch you were on after switching branches for more than several
> > > > times.
> >
> > This, together with a removal of the hard-coded limit of 16 could be
> > squashed with this patch:
>
> You know, I'm quite puzzled as to why we had working code that could
> read the reflog backwards earlier in this thread, but it got shot down
> solely based on impact and line counts, and you now have to jump
> through hoops to work around the lack of this exact functionality.
Okay, I should have told you what my two main concerns with the patch
were.
1) it introduces a lot of code, with a lot of possibility for bugs to hide
(and I found it not simple enough to slap my head and say "of course,
this is obvious" as I did with Junio's code (except the modulo thing
which I had to thing about for half a minute)).
2) on Windows, mmap() is really implemented as xmalloc() && fread(). So
all the shortcomings of what Junio said about my array approach would
hold true for your approach, too.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice
From: Thomas Rast @ 2009-01-20 0:41 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git, Johannes Sixt, Johan Herland
In-Reply-To: <alpine.DEB.1.00.0901200121190.3586@pacific.mpi-cbg.de>
[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]
Johannes Schindelin wrote:
> 1) it introduces a lot of code, with a lot of possibility for bugs to hide
And I can understand in the case of read_ref_at() since there the
translation is really nontrivial (though I'd readily put the blame on
the optimized-to-death original code ;-). But in the case of
for_each_reflog_ent(), it should be really straightforward.
> 2) on Windows, mmap() is really implemented as xmalloc() && fread(). So
> all the shortcomings of what Junio said about my array approach would
> hold true for your approach, too.
But the @{} syntax _already_ uses mmap via read_ref_at(). And both
uses of for_each_reflog_ent() I'm aware of, the existing git log -g
and the present @{-N} syntax, have to read to the end anyway because
they're mostly interested in the newer stuff.
So while the mmap() might occasionally grab a few more MB of RAM than
would actually be required with simple line-based input, Windows
has to read the whole reflog no matter what.
(Well, unless we make a for_each_reflog_ent_backward() that can jump
in somewhere near the end and start parsing lines backwards.)
--
Thomas Rast
trast@{inf,student}.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [StGit PATCH 2/2] Make bash completion fail to bashdefault before default completion.
From: ted @ 2009-01-20 0:46 UTC (permalink / raw)
To: catalin.marinas; +Cc: git, Ted Pavlic
In-Reply-To: <1232412373-10836-1-git-send-email-ted@tedpavlic.com>
From: Ted Pavlic <ted@tedpavlic.com>
If "-o bashdefault" isn't possible, use old "-o default" only.
(this patch inspired by similar mechanism in Mercurial bash completion
script)
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
---
stgit/completion.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/stgit/completion.py b/stgit/completion.py
index b3fd282..56e81c2 100644
--- a/stgit/completion.py
+++ b/stgit/completion.py
@@ -129,7 +129,8 @@ def main_switch(commands):
'esac')
def install():
- return ['complete -o default -F _stg stg']
+ return ['complete -o bashdefault -o default -F _stg stg 2>/dev/null \\', [
+ 'complete -o default -F _stg stg' ] ]
def write_completion(f):
commands = stgit.commands.get_commands(allow_cached = False)
--
1.6.1.87.g15624
^ permalink raw reply related
* [StGit PATCH 1/2] Modify bash completion to support help, version, and copyright.
From: ted @ 2009-01-20 0:46 UTC (permalink / raw)
To: catalin.marinas; +Cc: git, Ted Pavlic
From: Ted Pavlic <ted@tedpavlic.com>
"stg <tab>" lists all commands, including "help", "version", and
"copyright".
"stg he<tab>" completes "stg help "
"stg ver<tab>" completes "stg version "
"stg copy<tab>" completes "stg copyright "
"stg help <tab>" lists all commands /other than/ help, version, and
copyright.
"stg version <tab>" goes directly to shell completion.
"stg copyright <tab>" goes directly to shell completion.
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
---
stgit/completion.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/stgit/completion.py b/stgit/completion.py
index affc8c6..b3fd282 100644
--- a/stgit/completion.py
+++ b/stgit/completion.py
@@ -111,13 +111,19 @@ def main_switch(commands):
('# Complete name of subcommand if the user has not finished'
' typing it yet.'),
'if test $c -eq $COMP_CWORD -a -z "$command"; then', [
- ('COMPREPLY=($(compgen -W "$_stg_commands" --'
+ ('COMPREPLY=($(compgen -W "help version copyright $_stg_commands" --'
' "${COMP_WORDS[COMP_CWORD]}"))'),
'return'],
'fi',
'',
'# Complete arguments to subcommands.',
'case "$command" in', [
+ 'help) ', [
+ ('COMPREPLY=($(compgen -W "$_stg_commands" --'
+ ' "${COMP_WORDS[COMP_CWORD]}"))'),
+ 'return ;;'],
+ 'version) return ;;',
+ 'copyright) return ;;'], [
'%s) _stg_%s ;;' % (cmd, cmd)
for cmd in sorted(commands.iterkeys())],
'esac')
--
1.6.1.87.g15624
^ permalink raw reply related
* Re: [PATCH,v4] git-checkout(1): mention fate of extraneous files
From: Boyd Stephen Smith Jr. @ 2009-01-20 0:54 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, jidanni
In-Reply-To: <alpine.DEB.1.00.0901200110410.3586@pacific.mpi-cbg.de>
[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]
On Monday 19 January 2009, Johannes Schindelin <Johannes.Schindelin@gmx.de>
wrote about 'Re: [PATCH,v4] git-checkout(1): mention fate of extraneous
files':
>On Tue, 20 Jan 2009, jidanni@jidanni.org wrote:
>> Signed-off-by: jidanni <jidanni@jidanni.org>
>> ---
>> OK thanks Johannes.
>> I'm still worried that there is no exact statement on the fate of the
>> various different classes of files, but OK, moving this to only a SEE
>> ALSO.
>
>You completely misread me. So I will say it out directly: I think no
>patch is needed.
I think some users will expect to get a clean checkout when simply
doing "git checkout <branch>". It would be nice for the documentation
mention that is not the case, and reference the tool that helps get the
tree into that state. Just my opinion, though.
It seems natural to me for this to be mentioned in the 'git checkout'
documentation. Perhaps there's a better place?
--
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
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