* [PATCH v4 2/6] t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
From: Tay Ray Chuan @ 2010-01-08 2:12 UTC (permalink / raw)
To: git; +Cc: Jeff King, Junio C Hamano, Daniel Barkalow, Shawn O. Pearce
In-Reply-To: <1262916765-3728-2-git-send-email-rctay89@gmail.com>
Some refs can only be matched to a remote ref with an explicit refspec.
When such a ref is a non-fast-forward of its remote ref, test that
pushing them (with the explicit refspec specified) fails with a non-
fast-foward-type error (viz. printing of ref status and help message).
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
Changed from v3:
- Reworded commit message
- Reword the comments
- Used '*' instead of '\+' for grep expressions
- Used [a-f0-9] instead of [a-z0-9] for matching hexadecimals
- Used ' ' instead of '[ ]' for matching SP
t/t5541-http-push.sh | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index f49c7c4..cc740fe 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -111,5 +111,26 @@ Merge the remote changes before pushing again. See the '"'non-fast-forward'"'
section of '"'git push --help'"' for details." output
'
+test_expect_failure 'push fails for non-fast-forward refs unmatched by remote helper' '
+ # create a dissimilarly-named remote ref so that git is unable to match the
+ # two refs (viz. local, remote) unless an explicit refspec is provided.
+ git push origin master:retsam
+
+ echo "change changed" > path2 &&
+ git commit -a -m path2 --amend &&
+
+ # push master too; this ensures there is at least one '"'push'"' command to
+ # the remote helper and triggers interaction with the helper.
+ !(git push -v origin +master master:retsam >output 2>&1) &&
+
+ grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
+ grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&
+
+ grep \
+"To prevent you from losing history, non-fast-forward updates were rejected
+Merge the remote changes before pushing again. See the '"'non-fast-forward'"'
+section of '"'git push --help'"' for details." output
+'
+
stop_httpd
test_done
--
1.6.6.341.ga7aec
^ permalink raw reply related
* [PATCH v4 3/6] refactor ref status logic for pushing
From: Tay Ray Chuan @ 2010-01-08 2:12 UTC (permalink / raw)
To: git; +Cc: Jeff King, Junio C Hamano, Daniel Barkalow, Shawn O. Pearce
In-Reply-To: <1262916765-3728-3-git-send-email-rctay89@gmail.com>
Move the logic that detects up-to-date and non-fast-forward refs to a
new function in remote.[ch], set_ref_status_for_push().
Make transport_push() invoke set_ref_status_for_push() before invoking
the push_refs() implementation. (As a side-effect, the push_refs()
implementation in transport-helper.c now knows of non-fast-forward
pushes.)
Removed logic for detecting up-to-date refs from the push_refs()
implementation in transport-helper.c, as transport_push() has already
done so for it.
Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
send_pack(), as transport_push() can't do it for send_pack() here.
Mark the test on the return status of non-fast-forward push to fail.
Git now exits with success, as transport.c::transport_push() does not
check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
indicate rejected pushes with its return value.
Mark the test for ref status to succeed. As mentioned earlier, refs
might be marked as non-fast-forwards, triggering the push status
printing mechanism in transport.c.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
builtin-send-pack.c | 51 +++++++++++--------------------------------------
remote.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
remote.h | 2 +
t/t5541-http-push.sh | 4 +-
transport-helper.c | 14 ++++++------
transport.c | 4 +++
6 files changed, 77 insertions(+), 48 deletions(-)
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 8fffdbf..76c7206 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -406,50 +406,20 @@ int send_pack(struct send_pack_args *args,
*/
new_refs = 0;
for (ref = remote_refs; ref; ref = ref->next) {
-
- if (ref->peer_ref)
- hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
- else if (!args->send_mirror)
+ if (!ref->peer_ref && !args->send_mirror)
continue;
- ref->deletion = is_null_sha1(ref->new_sha1);
- if (ref->deletion && !allow_deleting_refs) {
- ref->status = REF_STATUS_REJECT_NODELETE;
- continue;
- }
- if (!ref->deletion &&
- !hashcmp(ref->old_sha1, ref->new_sha1)) {
- ref->status = REF_STATUS_UPTODATE;
+ /* Check for statuses set by set_ref_status_for_push() */
+ switch (ref->status) {
+ case REF_STATUS_REJECT_NONFASTFORWARD:
+ case REF_STATUS_UPTODATE:
continue;
+ default:
+ ; /* do nothing */
}
- /* This part determines what can overwrite what.
- * The rules are:
- *
- * (0) you can always use --force or +A:B notation to
- * selectively force individual ref pairs.
- *
- * (1) if the old thing does not exist, it is OK.
- *
- * (2) if you do not have the old thing, you are not allowed
- * to overwrite it; you would not know what you are losing
- * otherwise.
- *
- * (3) if both new and old are commit-ish, and new is a
- * descendant of old, it is OK.
- *
- * (4) regardless of all of the above, removing :B is
- * always allowed.
- */
-
- ref->nonfastforward =
- !ref->deletion &&
- !is_null_sha1(ref->old_sha1) &&
- (!has_sha1_file(ref->old_sha1)
- || !ref_newer(ref->new_sha1, ref->old_sha1));
-
- if (ref->nonfastforward && !ref->force && !args->force_update) {
- ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
+ if (ref->deletion && !allow_deleting_refs) {
+ ref->status = REF_STATUS_REJECT_NODELETE;
continue;
}
@@ -673,6 +643,9 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
if (match_refs(local_refs, &remote_refs, nr_refspecs, refspecs, flags))
return -1;
+ set_ref_status_for_push(remote_refs, args.send_mirror,
+ args.force_update);
+
ret = send_pack(&args, fd, conn, remote_refs, &extra_have);
if (helper_status)
diff --git a/remote.c b/remote.c
index e3afecd..c70181c 100644
--- a/remote.c
+++ b/remote.c
@@ -1247,6 +1247,56 @@ int match_refs(struct ref *src, struct ref **dst,
return 0;
}
+void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
+ int force_update)
+{
+ struct ref *ref;
+
+ for (ref = remote_refs; ref; ref = ref->next) {
+ if (ref->peer_ref)
+ hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
+ else if (!send_mirror)
+ continue;
+
+ ref->deletion = is_null_sha1(ref->new_sha1);
+ if (!ref->deletion &&
+ !hashcmp(ref->old_sha1, ref->new_sha1)) {
+ ref->status = REF_STATUS_UPTODATE;
+ continue;
+ }
+
+ /* This part determines what can overwrite what.
+ * The rules are:
+ *
+ * (0) you can always use --force or +A:B notation to
+ * selectively force individual ref pairs.
+ *
+ * (1) if the old thing does not exist, it is OK.
+ *
+ * (2) if you do not have the old thing, you are not allowed
+ * to overwrite it; you would not know what you are losing
+ * otherwise.
+ *
+ * (3) if both new and old are commit-ish, and new is a
+ * descendant of old, it is OK.
+ *
+ * (4) regardless of all of the above, removing :B is
+ * always allowed.
+ */
+
+ ref->nonfastforward =
+ !ref->deletion &&
+ !is_null_sha1(ref->old_sha1) &&
+ (!has_sha1_file(ref->old_sha1)
+ || !ref_newer(ref->new_sha1, ref->old_sha1));
+
+ if (ref->nonfastforward && !ref->force && !force_update) {
+ ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
+ continue;
+ }
+ }
+}
+
struct branch *branch_get(const char *name)
{
struct branch *ret;
diff --git a/remote.h b/remote.h
index 8b7ecf9..6e13643 100644
--- a/remote.h
+++ b/remote.h
@@ -98,6 +98,8 @@ char *apply_refspecs(struct refspec *refspecs, int nr_refspec,
int match_refs(struct ref *src, struct ref **dst,
int nr_refspec, const char **refspec, int all);
+void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
+ int force_update);
/*
* Given a list of the remote refs and the specification of things to
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index cc740fe..6d92196 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -88,7 +88,7 @@ test_expect_success 'used receive-pack service' '
test_cmp exp act
'
-test_expect_success 'non-fast-forward push fails' '
+test_expect_failure 'non-fast-forward push fails' '
cd "$ROOT_PATH"/test_repo_clone &&
git checkout master &&
echo "changed" > path2 &&
@@ -100,7 +100,7 @@ test_expect_success 'non-fast-forward push fails' '
test $HEAD != $(git rev-parse --verify HEAD))
'
-test_expect_failure 'non-fast-forward push show ref status' '
+test_expect_success 'non-fast-forward push show ref status' '
grep "^ ! \[rejected\][ ]*master -> master (non-fast-forward)$" output
'
diff --git a/transport-helper.c b/transport-helper.c
index 11f3d7e..7c9b569 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -329,16 +329,16 @@ static int push_refs(struct transport *transport,
return 1;
for (ref = remote_refs; ref; ref = ref->next) {
- if (ref->peer_ref)
- hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
- else if (!mirror)
+ if (!ref->peer_ref && !mirror)
continue;
- ref->deletion = is_null_sha1(ref->new_sha1);
- if (!ref->deletion &&
- !hashcmp(ref->old_sha1, ref->new_sha1)) {
- ref->status = REF_STATUS_UPTODATE;
+ /* Check for statuses set by set_ref_status_for_push() */
+ switch (ref->status) {
+ case REF_STATUS_REJECT_NONFASTFORWARD:
+ case REF_STATUS_UPTODATE:
continue;
+ default:
+ ; /* do nothing */
}
if (force_all)
diff --git a/transport.c b/transport.c
index 3eea836..12c4423 100644
--- a/transport.c
+++ b/transport.c
@@ -887,6 +887,10 @@ int transport_push(struct transport *transport,
return -1;
}
+ set_ref_status_for_push(remote_refs,
+ flags & TRANSPORT_PUSH_MIRROR,
+ flags & TRANSPORT_PUSH_FORCE);
+
ret = transport->push_refs(transport, remote_refs, flags);
if (!quiet || push_had_errors(remote_refs))
--
1.6.6.341.ga7aec
^ permalink raw reply related
* [PATCH v4 4/6] transport.c::transport_push(): make ref status affect return value
From: Tay Ray Chuan @ 2010-01-08 2:12 UTC (permalink / raw)
To: git; +Cc: Jeff King, Junio C Hamano, Daniel Barkalow, Shawn O. Pearce
In-Reply-To: <1262916765-3728-4-git-send-email-rctay89@gmail.com>
Use push_had_errors() to check the refs for errors and modify the
return value.
Mark the non-fast-forward push tests to succeed.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
t/t5541-http-push.sh | 4 ++--
transport.c | 7 +++++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 6d92196..979624d 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -88,7 +88,7 @@ test_expect_success 'used receive-pack service' '
test_cmp exp act
'
-test_expect_failure 'non-fast-forward push fails' '
+test_expect_success 'non-fast-forward push fails' '
cd "$ROOT_PATH"/test_repo_clone &&
git checkout master &&
echo "changed" > path2 &&
@@ -104,7 +104,7 @@ test_expect_success 'non-fast-forward push show ref status' '
grep "^ ! \[rejected\][ ]*master -> master (non-fast-forward)$" output
'
-test_expect_failure 'non-fast-forward push shows help message' '
+test_expect_success 'non-fast-forward push shows help message' '
grep \
"To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the '"'non-fast-forward'"'
diff --git a/transport.c b/transport.c
index 12c4423..9b23989 100644
--- a/transport.c
+++ b/transport.c
@@ -875,7 +875,7 @@ int transport_push(struct transport *transport,
int verbose = flags & TRANSPORT_PUSH_VERBOSE;
int quiet = flags & TRANSPORT_PUSH_QUIET;
int porcelain = flags & TRANSPORT_PUSH_PORCELAIN;
- int ret;
+ int ret, err;
if (flags & TRANSPORT_PUSH_ALL)
match_flags |= MATCH_REFS_ALL;
@@ -892,8 +892,11 @@ int transport_push(struct transport *transport,
flags & TRANSPORT_PUSH_FORCE);
ret = transport->push_refs(transport, remote_refs, flags);
+ err = push_had_errors(remote_refs);
- if (!quiet || push_had_errors(remote_refs))
+ ret |= err;
+
+ if (!quiet || err)
print_push_status(transport->url, remote_refs,
verbose | porcelain, porcelain,
nonfastforward);
--
1.6.6.341.ga7aec
^ permalink raw reply related
* [PATCH v4 5/6] transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
From: Tay Ray Chuan @ 2010-01-08 2:12 UTC (permalink / raw)
To: git; +Cc: Jeff King, Junio C Hamano, Daniel Barkalow, Shawn O. Pearce
In-Reply-To: <1262916765-3728-5-git-send-email-rctay89@gmail.com>
If the status of a ref is REF_STATUS_NONE, the remote helper will not
be told to push the ref (via a 'push' command).
However, the remote helper may still act on these refs.
If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.
This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.
Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
Changed from v3:
- consider a ref as marked not for pushing if its status is _not_
none, rather than checking if the status is nonff or uptodate.
- ignore ref status reported by remote helper only if it reported 'no
match'
t/t5541-http-push.sh | 2 +-
transport-helper.c | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 979624d..83a8e14 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -111,7 +111,7 @@ Merge the remote changes before pushing again. See the '"'non-fast-forward'"'
section of '"'git push --help'"' for details." output
'
-test_expect_failure 'push fails for non-fast-forward refs unmatched by remote helper' '
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
# create a dissimilarly-named remote ref so that git is unable to match the
# two refs (viz. local, remote) unless an explicit refspec is provided.
git push origin master:retsam
diff --git a/transport-helper.c b/transport-helper.c
index 7c9b569..71a1e50 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -430,6 +430,15 @@ static int push_refs(struct transport *transport,
continue;
}
+ if (ref->status != REF_STATUS_NONE) {
+ /*
+ * Earlier, the ref was marked not to be pushed, so ignore the ref
+ * status reported by the remote helper if the latter is 'no match'.
+ */
+ if (status == REF_STATUS_NONE)
+ continue;
+ }
+
ref->status = status;
ref->remote_status = msg;
}
--
1.6.6.341.ga7aec
^ permalink raw reply related
* [PATCH v4 6/6] transport-helper.c::push_refs(): emit "no refs" error message
From: Tay Ray Chuan @ 2010-01-08 2:12 UTC (permalink / raw)
To: git; +Cc: Jeff King, Junio C Hamano, Daniel Barkalow, Shawn O. Pearce
In-Reply-To: <1262916765-3728-6-git-send-email-rctay89@gmail.com>
Emit an error message when remote_refs is not set.
This behaviour is consistent with that of builtin-send-pack.c and
http-push.c.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
transport-helper.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 71a1e50..8c0b575 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -321,8 +321,11 @@ static int push_refs(struct transport *transport,
struct child_process *helper;
struct ref *ref;
- if (!remote_refs)
+ if (!remote_refs) {
+ fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
+ "Perhaps you should specify a branch such as 'master'.\n");
return 0;
+ }
helper = get_helper(transport);
if (!data->push)
--
1.6.6.341.ga7aec
^ permalink raw reply related
* Re: [PATCH] Add quiet option to git-ls-files
From: Ramkumar Ramachandra @ 2010-01-08 2:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1vi14qiy.fsf@alter.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
> The code doesn't seem to match the claim.
I'm sorry- That was horribly sloppy of me. I figured that passing
`quiet' to report_path_error would break too many things, so I've
dropped that patch altogether. I've removed the reference to ls-files
--quiet in my second patch ( viz.
0002-Replace-redirect-to-dev-null-in-favor-of-quiet-optio.patch) and
attached version 2.
Thanks and regards,
Ramkumar
[-- Attachment #2: 0002-Replace-redirect-to-dev-null-in-favor-of-quiet-optio.patch --]
[-- Type: text/x-patch, Size: 3213 bytes --]
From c34c72801804da61169ab6866d6ce262ea6cf5c1 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <artagnon@gmail.com>
Date: Fri, 8 Jan 2010 07:32:29 +0530
Subject: [PATCH v2] Replace redirect to /dev/null in favor of quiet option
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
git-mergetool.sh | 2 +-
git-pull.sh | 2 +-
git-rebase.sh | 2 +-
git-stash.sh | 12 ++++++------
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index b52a741..1c902aa 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -101,7 +101,7 @@ resolve_deleted_merge () {
return 0
;;
[dD]*)
- git rm -- "$MERGED" > /dev/null
+ git rm --quiet -- "$MERGED"
cleanup_temp_files
return 0
;;
diff --git a/git-pull.sh b/git-pull.sh
index 9e69ada..336e91a 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -170,7 +170,7 @@ test true = "$rebase" && {
. git-parse-remote &&
remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
oldremoteref="$(git rev-parse -q --verify "$remoteref")" &&
- for reflog in $(git rev-list -g $remoteref 2>/dev/null)
+ for reflog in $(git rev-list --quiet --walk-reflogs $remoteref)
do
if test "$reflog" = "$(git merge-base $reflog $curr_branch)"
then
diff --git a/git-rebase.sh b/git-rebase.sh
index b121f45..bfe0475 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -100,7 +100,7 @@ call_merge () {
cmt="$(cat "$dotest/cmt.$1")"
echo "$cmt" > "$dotest/current"
hd=$(git rev-parse --verify HEAD)
- cmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)
+ cmt_name=$(git symbolic-ref --quiet HEAD || echo HEAD)
msgnum=$(cat "$dotest/msgnum")
end=$(cat "$dotest/end")
eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
diff --git a/git-stash.sh b/git-stash.sh
index 3a0685f..5605d19 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -39,7 +39,7 @@ clear_stash () {
then
die "git stash clear with parameters is unimplemented"
fi
- if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
+ if current=$(git rev-parse --quiet --verify $ref_stash)
then
git update-ref -d $ref_stash $current
fi
@@ -200,7 +200,7 @@ save_stash () {
}
have_stash () {
- git rev-parse --verify $ref_stash >/dev/null 2>&1
+ git rev-parse --quiet --verify $ref_stash >/dev/null
}
list_stash () {
@@ -337,16 +337,16 @@ drop_stash () {
fi
# Verify supplied argument looks like a stash entry
s=$(git rev-parse --verify "$@") &&
- git rev-parse --verify "$s:" > /dev/null 2>&1 &&
- git rev-parse --verify "$s^1:" > /dev/null 2>&1 &&
- git rev-parse --verify "$s^2:" > /dev/null 2>&1 ||
+ git rev-parse --quiet --verify "$s:" > /dev/null &&
+ git rev-parse --quiet --verify "$s^1:" > /dev/null &&
+ git rev-parse --quiet --verify "$s^2:" > /dev/null ||
die "$*: not a valid stashed state"
git reflog delete --updateref --rewrite "$@" &&
say "Dropped $* ($s)" || die "$*: Could not drop stash entry"
# clear_stash if we just dropped the last stash entry
- git rev-parse --verify "$ref_stash@{0}" > /dev/null 2>&1 || clear_stash
+ git rev-parse --quiet --verify "$ref_stash@{0}" > /dev/null || clear_stash
}
apply_to_branch () {
--
1.6.5
^ permalink raw reply related
* Re: [PATCH 1/5] MSVC: Windows-native implementation for subset of Pthreads API
From: Dmitry Potapov @ 2010-01-08 3:32 UTC (permalink / raw)
To: Johannes Sixt; +Cc: msysgit, git, Andrzej K. Haczewski
In-Reply-To: <44c7183e43089c64fb65bd248f7fa5b9731067ea.1262895936.git.j6t@kdbg.org>
On Thu, Jan 07, 2010 at 10:54:57PM +0100, Johannes Sixt wrote:
> +
> +int pthread_cond_init(pthread_cond_t *cond, const void *unused)
> +{
> + cond->waiters = 0;
> +
> + InitializeCriticalSection(&cond->waiters_lock);
Is waiters_lock really necessary?
> +
> +int pthread_cond_wait(pthread_cond_t *cond, CRITICAL_SECTION *mutex)
> +{
> + /* serialize access to waiters count */
> + EnterCriticalSection(&cond->waiters_lock);
> + ++cond->waiters;
> + LeaveCriticalSection(&cond->waiters_lock);
InterlockedIncrement(&cond->waiters);
> +
> + /*
> + * Unlock external mutex and wait for signal.
> + * NOTE: we've held mutex locked long enough to increment
> + * waiters count above, so there's no problem with
> + * leaving mutex unlocked before we wait on semaphore.
> + */
> + LeaveCriticalSection(mutex);
> +
> + /* let's wait - ignore return value */
> + WaitForSingleObject(cond->sema, INFINITE);
> +
> + /* we're done waiting, so make sure we decrease waiters count */
> + EnterCriticalSection(&cond->waiters_lock);
> + --cond->waiters;
> + LeaveCriticalSection(&cond->waiters_lock);
InterlockedDecrement(&cond->waiters);
> +
> + /* lock external mutex again */
> + EnterCriticalSection(mutex);
> +
> + return 0;
> +}
> +
> +int pthread_cond_signal(pthread_cond_t *cond)
> +{
> + int have_waiters;
> +
> + /* serialize access to waiters count */
> + EnterCriticalSection(&cond->waiters_lock);
> + have_waiters = cond->waiters > 0;
> + LeaveCriticalSection(&cond->waiters_lock);
AFAIK, Win32 API assumes that reading LONG is always atomic, so
the critical section is not really necesary here, but you need
to declare 'waiters' as 'volatile':
> + */
> +typedef struct {
> + LONG waiters;
volatile LONG waiters;
> + CRITICAL_SECTION waiters_lock;
> + HANDLE sema;
> +} pthread_cond_t;
> +
Dmitry
^ permalink raw reply
* Re: Two versions of a project in one GIT repository
From: Dmitry Potapov @ 2010-01-08 3:57 UTC (permalink / raw)
To: Kacper; +Cc: git
In-Reply-To: <1262912794001-4269785.post@n2.nabble.com>
On Thu, Jan 07, 2010 at 05:06:34PM -0800, Kacper wrote:
>
> I have two versions of one project in one local git repository. I have to
> commit this repository into 2 remote repositories, one for each version;
>
> LOCAL GIT(V1/V2) -> REMOTE GIT(V1), REMOTE GIT(V2)
>
> I have some files in the LOCAL GIT repository which should only go to REMOTE
> GIT(V1) and other should only go to REMOTE GIT(V2). Now I commit full local
> repository to both remotes. Can I only commit some files to REMOTE1?
You do not commit to any remote. You _always_ commit to the local repository.
Then using 'git push', you propagate your changes, and you can propagate any
commit to any remote repository of your choice, but you can only to push the
_whole_ commit, which implies the whole tree and all parents commits as well.
> I need to have both version of the project in one repository, but would like
> to have an options to divide history a bit.
You can add as many remote repository as you like using 'git remote add'.
> I do not think that any
> branching can help as then I would have to make the same changes to both
> branches mostly. Most of the code, 90% of the code is the same for VER 1 and
> VER 2. New code is usually the same for both versions.
You can commit only to one branch and then merge your changes to another. In
general case, you may want to have a special branch to commit common changes
and then to merge it to V1 and V2. Though, I guess it is a bit inconvinient.
However, if the difference between V1 and V2 is not large, and you do mind
having V1 history visible as part of V2 history then you may have just two
branches. You create V2 based on V1, by adding V2 specific files and removing
V1 specific files. After that you made all your work on V1 and periodically
merge V1 to V2. Changes made to V1 specific files will cause conflict during
merge to V2, but you can easily resolve by doing 'git rm' on V1 specific
files.
To better understand Git model, I suggest you read "Git for Computer
Scientists" http://eagain.net/articles/git-for-computer-scientists/
Dmitry
^ permalink raw reply
* [PATCH] t7111: check that reset options work as described in the tables
From: Christian Couder @ 2010-01-08 4:45 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Linus Torvalds, Johannes Schindelin, Stephan Beyer,
Daniel Barkalow, Jakub Narebski, Paolo Bonzini, Johannes Sixt,
Stephen Boyd
Some previous patches added some tables to the "git reset"
documentation. These tables describe the behavior of "git reset"
depending on the option it is passed and the state of the files
in the working tree, the index, HEAD and the target commit.
This patch adds some tests to make sure that the tables describe
the behavior of "git reset".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
t/t7111-reset-table.sh | 121 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 121 insertions(+), 0 deletions(-)
create mode 100755 t/t7111-reset-table.sh
diff --git a/t/t7111-reset-table.sh b/t/t7111-reset-table.sh
new file mode 100755
index 0000000..16b33a5
--- /dev/null
+++ b/t/t7111-reset-table.sh
@@ -0,0 +1,121 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Christian Couder
+#
+
+test_description='Tests to check that "reset" options follow a known table'
+
+. ./test-lib.sh
+
+
+test_expect_success 'creating initial commits' '
+ test_commit E file1 &&
+ test_commit D file1 &&
+ test_commit C file1
+'
+
+test_expect_success 'creating table file 1' '
+ cat <<EOF >table1
+A B C D soft A B D
+A B C D mixed A D D
+A B C D hard D D D
+A B C D merge XXXXX
+A B C C soft A B C
+A B C C mixed A C C
+A B C C hard C C C
+A B C C merge XXXXX
+B B C D soft B B D
+B B C D mixed B D D
+B B C D hard D D D
+B B C D merge D D D
+B B C C soft B B C
+B B C C mixed B C C
+B B C C hard C C C
+B B C C merge C C C
+B C C D soft B C D
+B C C D mixed B D D
+B C C D hard D D D
+B C C D merge XXXXX
+B C C C soft B C C
+B C C C mixed B C C
+B C C C hard C C C
+B C C C merge B C C
+EOF
+'
+
+while read W1 I1 H1 T opt W2 I2 H2
+do
+ test_expect_success "check: $W1 $I1 $H1 $T --$opt $W2 $I2 $H2" '
+ git reset --hard C &&
+ if [ "$I1" != "$H1" ]
+ then
+ echo "$I1" > file1 &&
+ git add file1
+ fi &&
+ if [ "$W1" != "$I1" ]
+ then
+ echo "$W1" > file1
+ fi &&
+ if [ "$W2" != "XXXXX" ]
+ then
+ git reset --$opt $T &&
+ test "$(cat file1)" = "$W2" &&
+ git checkout-index -f -- file1 &&
+ test "$(cat file1)" = "$I2" &&
+ git checkout -f HEAD -- file1 &&
+ test "$(cat file1)" = "$H2"
+ else
+ test_must_fail git reset --$opt $T
+ fi
+ '
+done < table1
+
+test_expect_success 'setting up branches to test with unmerged entries' '
+ git reset --hard C &&
+ git branch branch1 &&
+ git branch branch2 &&
+ git checkout branch1 &&
+ test_commit B1 file1 &&
+ git checkout branch2 &&
+ test_commit B2 file1
+'
+
+test_expect_success 'creating table file 2' '
+ cat <<EOF >table2
+X U C D soft XXXXX
+X U C D mixed X D D
+X U C D hard D D D
+X U C D merge D D D
+X U C C soft XXXXX
+X U C C mixed X C C
+X U C C hard C C C
+X U C C merge C C C
+EOF
+'
+
+while read W1 I1 H1 T opt W2 I2 H2
+do
+ test_expect_success "check: $W1 $I1 $H1 $T --$opt $W2 $I2 $H2" '
+ git reset --hard B2 &&
+ test_must_fail git merge branch1 &&
+ cat file1 >X_file1 &&
+ if [ "$W2" != "XXXXX" ]
+ then
+ git reset --$opt $T &&
+ if [ "$W2" = "X" ]
+ then
+ test_cmp file1 X_file1
+ else
+ test "$(cat file1)" = "$W2"
+ fi &&
+ git checkout-index -f -- file1 &&
+ test "$(cat file1)" = "$I2" &&
+ git checkout -f HEAD -- file1 &&
+ test "$(cat file1)" = "$H2"
+ else
+ test_must_fail git reset --$opt $T
+ fi
+ '
+done < table2
+
+test_done
--
1.6.6.rc2.5.g49666
^ permalink raw reply related
* Re: git-log - hide parent (was: merging two equivalent branches)
From: Christian Couder @ 2010-01-08 5:00 UTC (permalink / raw)
To: David Reitter; +Cc: git, Christian MICHON
In-Reply-To: <DF05F91F-CBFD-458A-A99F-79E98ACA5146@gmail.com>
On jeudi 07 janvier 2010, David Reitter wrote:
> On Jan 7, 2010, at 1:22 PM, Christian MICHON wrote:
> > I recall asking a similar question in 2008, and the answer was to look
> > at "git graft" and use "git filter-branch" to recreate history.
>
> Thanks, I've tried that and I recall that filter-branch wasn't willing to
> rewrite just the recent history - at least in started going over all 100k
> revisions at a very slow pace.
>
> I'm still unsure how, after the filter-branch, I would have some ancestor
> from the B series so that future pulls from the remote work, while having
> an ancestor from A, to make sure I can continue merging into C. If
> history is rewritten, I'll get new revisions and lose ancestors. I'm
> beginning to thing that the cutting and pasting I'd like is conceptually
> impossible.
>
> So what one would need is to specify a "silent parent" for a revision
> that is relevant w.r.t. future three-way merges, but indicates that the
> history behind the silent parent is irrelevant and shouldn't be shown in
> a git-log. The runaway parent would be guaranteed to _not_ contribute
> any content to the tree of the child revision, as is the case with a
> "merge ours".
What you could perhaps do with "git replace" or a graft is to change the
merge commit so that it has only one parent instead of 2.
> This could be implemented as a way to mark a parent as silent (checked by
> git-log at least), but one could also allow for an empty commit that,
> while having a normal parent, clears out the tree.
>
> Let me know if this idea is completely crazy. --
This looks like the right thing to do using "git replace" or grafts.
Best regards,
Christian.
^ permalink raw reply
* Re: [StGit PATCH 1/2] Rename the mail --refid and --noreply options to match Git
From: Karl Wiberg @ 2010-01-08 6:35 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <20100107160932.3226.95737.stgit@pc1117.cambridge.arm.com>
Looks good.
--
Karl Wiberg, kha@treskal.com
subrabbit.wordpress.com
www.treskal.com/kalle
^ permalink raw reply
* Re: [StGit PATCH 2/2] Pass the --in-reply-to and --no-thread options to git send-email
From: Karl Wiberg @ 2010-01-08 6:43 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <20100107160937.3226.14811.stgit@pc1117.cambridge.arm.com>
On Thu, Jan 7, 2010 at 5:09 PM, Catalin Marinas <catalin.marinas@arm.com> wrote:
> + if options.in_reply_to:
> + cmd.append("--in-reply-to %s" % options.in_reply_to)
Have you tested this? I'm pretty sure you need "--in-reply-to=%s", or
to add the two strings separately---since as far as I can see, this
command is never shell-expanded.
--
Karl Wiberg, kha@treskal.com
subrabbit.wordpress.com
www.treskal.com/kalle
^ permalink raw reply
* Re: edit Author/Date metadata as part of 'git commit' $EDITOR invocation?
From: Adam Megacz @ 2010-01-08 7:35 UTC (permalink / raw)
To: git
In-Reply-To: <7v4omz17xz.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Nanako Shiraishi <nanako3@lavabit.com> writes:
>> Quoting Adam Megacz <adam@megacz.com>
>>> Perhaps a preference (off by default) demanding that they be set
>>> explicitly when "git commit -m" is used?
>> Sverre pointed out why this won't work.
I agree; making it a preference will not help.
I propose instead that "git commit -e" cause the metadata headers to be
provided to $EDITOR. People who care about the metadata can simply get
in the habit of always passing that option when invoking "git commit".
> The approach may have been Ok 10 years ago, back when `whoami`@`hostname`,
> at least on systems that were competently maintained, gave a reasonable
> mail address for most people, but I don't think it is adequate anymore to
> majority of people,
I agree.
> So I don't think anybody minds if we refuse to work if we are going to end
> up using a name that we didn't get from an explicit end user configuration
> (i.e. GIT_*_EMAIL and GIT_*_NAME environment and user.* configuration
> variables).
I support that as well, although I'd still like to be shown the data. I
wear a few different hats (each with its own email address), and I don't
think I want to pick one of them as the default.
Thanks,
- a
^ permalink raw reply
* What's cooking in git.git (Jan 2010, #02; Thu, 07)
From: Junio C Hamano @ 2010-01-08 7:42 UTC (permalink / raw)
To: git
In-Reply-To: <7vaawqna55.fsf@alter.siamese.dyndns.org>
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'. The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.
The tip of 'next' has been rebuilt on top of the current 'master'.
--------------------------------------------------
[Graduated to "master"]
* mo/bin-wrappers (2009-12-02) 3 commits
(merged to 'next' on 2010-01-03 at 8c5fa27)
+ INSTALL: document a simpler way to run uninstalled builds
+ run test suite without dashed git-commands in PATH
+ build dashless "bin-wrappers" directory similar to installed bindir
* mv/commit-date (2009-12-03) 2 commits
(merged to 'next' on 2010-01-03 at 1c45fdf)
+ Document date formats accepted by parse_date()
+ builtin-commit: add --date option
* bg/maint-add-all-doc (2009-12-07) 4 commits
(merged to 'next' on 2010-01-03 at b19a323)
+ squash! rm documentation--also mention add-u where we mention commit-a
+ git-rm doc: Describe how to sync index & work tree
+ git-add/rm doc: Consistently back-quote
+ Documentation: 'git add -A' can remove files
* so/cvsserver-update (2009-12-07) 1 commit
(merged to 'next' on 2010-01-03 at 99959b6)
+ cvsserver: make the output of 'update' more compatible with cvs.
* mg/tag-d-show (2009-12-10) 1 commit
(merged to 'next' on 2010-01-03 at 87657d2)
+ tag -d: print sha1 of deleted tag
* sb/maint-octopus (2009-12-11) 3 commits
(merged to 'next' on 2010-01-03 at ffe77d6)
+ octopus: remove dead code
+ octopus: reenable fast-forward merges
+ octopus: make merge process simpler to follow
* js/filter-branch-prime (2009-12-15) 1 commit
(merged to 'next' on 2010-01-03 at 7c90319)
+ filter-branch: remove an unnecessary use of 'git read-tree'
--------------------------------------------------
[New Topics]
* jc/maint-1.6.1-checkout-m-custom-merge (2010-01-06) 1 commit
- checkout -m path: fix recreating conflicts
* jn/makefile (2010-01-06) 4 commits
- Makefile: consolidate .FORCE-* targets
- Makefile: learn to generate listings for targets requiring special flags
- Makefile: use target-specific variable to pass flags to cc
- Makefile: regenerate assembler listings when asked
--------------------------------------------------
[Will graduate after a bit more cooking]
* tr/http-updates (2009-12-28) 4 commits
(merged to 'next' on 2010-01-02 at cf25698)
+ Remove http.authAny
+ Allow curl to rewind the RPC read buffer
+ Add an option for using any HTTP authentication scheme, not only basic
+ http: maintain curl sessions
* nd/sparse (2010-01-04) 25 commits
- t7002: test for not using external grep on skip-worktree paths
- t7002: set test prerequisite "external-grep" if supported
(merged to 'next' on 2010-01-02 at 5499bbe)
+ grep: do not do external grep on skip-worktree entries
+ commit: correctly respect skip-worktree bit
+ ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE_VALID
+ tests: rename duplicate t1009
+ sparse checkout: inhibit empty worktree
+ Add tests for sparse checkout
+ read-tree: add --no-sparse-checkout to disable sparse checkout support
+ unpack-trees(): ignore worktree check outside checkout area
+ unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
+ unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
+ unpack-trees.c: generalize verify_* functions
+ unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
+ Introduce "sparse checkout"
+ dir.c: export excluded_1() and add_excludes_from_file_1()
+ excluded_1(): support exclude files in index
+ unpack-trees(): carry skip-worktree bit over in merged_entry()
+ Read .gitignore from index if it is skip-worktree
+ Avoid writing to buffer in add_excludes_from_file_1()
+ Teach Git to respect skip-worktree bit (writing part)
+ Teach Git to respect skip-worktree bit (reading part)
+ Introduce "skip-worktree" bit in index, teach Git to get/set this bit
+ Add test-index-version
+ update-index: refactor mark_valid() in preparation for new options
* jk/maint-1.6.5-reset-hard (2009-12-30) 1 commit
(merged to 'next' on 2010-01-02 at 190d63b)
+ reset: unbreak hard resets with GIT_WORK_TREE
* jk/push-to-delete (2009-12-30) 1 commit
(merged to 'next' on 2010-01-03 at 9ee293b)
+ builtin-push: add --delete as syntactic sugar for :foo
* mm/config-path (2009-12-30) 1 commit
(merged to 'next' on 2010-01-03 at 9c0e81a)
+ builtin-config: add --path option doing ~ and ~user expansion.
* pm/cvs-environ (2009-12-30) 1 commit
(merged to 'next' on 2010-01-03 at 4c22932)
+ CVS Server: Support reading base and roots from environment
* tr/maint-1.6.5-bash-prompt-show-submodule-changes (2009-12-31) 1 commit
(merged to 'next' on 2010-01-03 at b785974)
+ bash completion: factor submodules into dirty state
* bg/maint-remote-update-default (2009-12-31) 1 commit
(merged to 'next' on 2010-01-03 at 113009e)
+ Fix "git remote update" with remotes.defalt set
--------------------------------------------------
[Cooking]
* da/difftool (2009-12-22) 2 commits
(merged to 'next' on 2010-01-06 at e957395)
+ git-difftool: Add '--gui' for selecting a GUI tool
+ t7800-difftool: Set a bogus tool for use by tests
* jh/gitweb-cached (2010-01-03) 4 commits
- gitweb: Makefile improvements
- gitweb: Optionally add "git" links in project list page
- gitweb: Add option to force version match
- gitweb: Load checking
Will merge to 'next', unless I hear objections within a few days.
* tc/test-locate-httpd (2010-01-02) 1 commit
(merged to 'next' on 2010-01-06 at 9d913e5)
+ t/lib-http.sh: Restructure finding of default httpd location
* jc/fix-tree-walk (2009-09-14) 7 commits
- read-tree --debug-unpack
- unpack-trees.c: look ahead in the index
- unpack-trees.c: prepare for looking ahead in the index
- Aggressive three-way merge: fix D/F case
- traverse_trees(): handle D/F conflict case sanely
- more D/F conflict tests
- tests: move convenience regexp to match object names to test-lib.sh
Resurrected from "Ejected" category. This is fix for a tricky codepath
and testing and improving before it hits 'next' by brave souls is greatly
appreciated. I am not very happy about the solution myself.
* cc/reset-more (2010-01-08) 8 commits
- t7111: check that reset options work as described in the tables
(merged to 'next' on 2010-01-06 at 96639cb)
+ Documentation: reset: add some missing tables
(merged to 'next' on 2010-01-04 at 8802c2c)
+ Fix bit assignment for CE_CONFLICTED
(merged to 'next' on 2010-01-03 at f83d4c6)
+ "reset --merge": fix unmerged case
+ reset: use "unpack_trees()" directly instead of "git read-tree"
+ reset: add a few tests for "git reset --merge"
+ Documentation: reset: add some tables to describe the different options
+ reset: improve mixed reset error message when in a bare repo
* jc/branch-d (2009-12-29) 1 commit
- branch -d: base the "already-merged" safety on the branch it merges with
http://thread.gmane.org/gmane.comp.version-control.git/135837/focus=135863
I am tempted to merge this to 'next', but please stop me if people see issues
in it.
* jc/rerere (2009-12-04) 1 commit
- Teach --[no-]rerere-autoupdate option to merge, revert and friends
* jk/run-command-use-shell (2010-01-01) 8 commits
- t4030, t4031: work around bogus MSYS bash path conversion
- diff: run external diff helper with shell
- textconv: use shell to run helper
- editor: use run_command's shell feature
- run-command: optimize out useless shell calls
- run-command: convert simple callsites to use_shell
- t0021: use $SHELL_PATH for the filter script
- run-command: add "use shell" option
Shuffled the commits in the topic, following J6t's suggestion in
http://thread.gmane.org/gmane.comp.version-control.git/136128
* rs/maint-archive-match-pathspec (2009-12-12) 1 commit
(merged to 'next' on 2010-01-03 at 92d7d15)
+ archive: complain about path specs that don't match anything
* tc/clone-v-progress (2009-12-26) 4 commits
- clone: use --progress to force progress reporting
- clone: set transport->verbose when -v/--verbose is used
- git-clone.txt: reword description of progress behaviour
- check stderr with isatty() instead of stdout when deciding to show progress
Perhaps needs an entry in the Release Notes, but otherwise looked Ok.
* tc/smart-http-restrict (2010-01-02) 4 commits
(merged to 'next' on 2010-01-06 at 82736cb)
+ Smart-http tests: Test http-backend without curl or a webserver
+ Smart-http tests: Break test t5560-http-backend into pieces
+ Smart-http tests: Improve coverage in test t5560
+ Smart-http: check if repository is OK to export before serving it
* jc/cache-unmerge (2009-12-25) 9 commits
- rerere forget path: forget recorded resolution
- rerere: refactor rerere logic to make it independent from I/O
- rerere: remove silly 1024-byte line limit
- resolve-undo: teach "update-index --unresolve" to use resolve-undo info
- resolve-undo: "checkout -m path" uses resolve-undo information
- resolve-undo: allow plumbing to clear the information
- resolve-undo: basic tests
- resolve-undo: record resolved conflicts in a new index extension section
- builtin-merge.c: use standard active_cache macros
Will wait a bit more before moving it to 'next'.
* jh/commit-status (2009-12-07) 1 commit
- [test?] Add commit.status, --status, and --no-status
Needs tests.
* jc/checkout-merge-base (2010-01-07) 4 commits
(merged to 'next' on 2010-01-07 at 5229608)
+ rebase -i: teach --onto A...B syntax
+ rebase: fix --onto A...B parsing and add tests
(merged to 'next' on 2010-01-02 at 6a8f6fc)
+ "rebase --onto A...B" replays history on the merge base between A and B
+ "checkout A...B" switches to the merge base between A and B
* tr/http-push-ref-status (2009-12-24) 6 commits
- transport-helper.c::push_refs(): emit "no refs" error message
- transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
- transport.c::transport_push(): make ref status affect return value
- refactor ref status logic for pushing
- t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
- t5541-http-push.sh: add tests for non-fast-forward pushes
Peff: $gmane/136169, 136167, 136168
RC: $gmane/136172
* il/vcs-helper (2009-12-09) 8 commits
(merged to 'next' on 2010-01-06 at 7c79f42)
+ Remove special casing of http, https and ftp
+ Support remote archive from all smart transports
+ Support remote helpers implementing smart transports
+ Support taking over transports
+ Refactor git transport options parsing
+ Pass unknown protocols to external protocol handlers
+ Support mandatory capabilities
+ Add remote helper debug mode
* mm/diag-path-in-treeish (2009-12-07) 1 commit
(merged to 'next' on 2010-01-06 at 6b4201e)
+ Detailed diagnosis when parsing an object name fails.
* mh/rebase-fixup (2009-12-07) 2 commits
(merged to 'next' on 2010-01-06 at c4779a7)
+ Add a command "fixup" to rebase --interactive
+ t3404: Use test_commit to set up test repository
(this branch is used by ns/rebase-auto-squash.)
Initial round of "fixup" action that is similar to "squash" action in
"rebase -i" that excludes the commit log message from follow-up commits
when composing the log message for the updated one. Expected is a further
improvement to skip opening the editor if a pick is followed only by
"fixup" and no "squash".
* ns/rebase-auto-squash (2009-12-08) 1 commit
(merged to 'next' on 2010-01-06 at da4e2f5)
+ rebase -i --autosquash: auto-squash commits
(this branch uses mh/rebase-fixup.)
* jh/notes (2009-12-07) 11 commits
- Refactor notes concatenation into a flexible interface for combining notes
- Notes API: Allow multiple concurrent notes trees with new struct notes_tree
- Notes API: for_each_note(): Traverse the entire notes tree with a callback
- Notes API: get_note(): Return the note annotating the given object
- Notes API: add_note(): Add note objects to the internal notes tree structure
- Notes API: init_notes(): Initialize the notes tree from the given notes ref
- Notes API: get_commit_notes() -> format_note() + remove the commit restriction
- Minor style fixes to notes.c
(merged to 'next' on 2010-01-02 at ae42130)
+ Add more testcases to test fast-import of notes
+ Rename t9301 to t9350, to make room for more fast-import tests
+ fast-import: Proper notes tree manipulation
http://thread.gmane.org/gmane.comp.version-control.git/134738
What's the status of the fourth and later patches on this topic? Overall
it looked reasonable, if I recall correctly what I thought when I reviewed
it last time, and I am tempted to merge it to 'next' soonish. Please
file complaints before I do so if people have objections.
http://mid.gmane.org/201001051231.43048.johan@herland.net Hold!
* fc/opt-quiet-gc-reset (2009-12-02) 1 commit
(merged to 'next' on 2010-01-06 at 03e00cd)
+ General --quiet improvements
* sr/gfi-options (2009-12-04) 7 commits
- fast-import: add (non-)relative-marks feature
- fast-import: allow for multiple --import-marks= arguments
- fast-import: test the new option command
- fast-import: add option command
- fast-import: add feature command
- fast-import: put marks reading in its own function
- fast-import: put option parsing code in separate functions
http://thread.gmane.org/gmane.comp.version-control.git/134540
I haven't seen comments on this round, and I am tempted to merge it to
'next' soonish. Please file complaints before I do so if people have
objections.
* ap/merge-backend-opts (2008-07-18) 6 commits
- Document that merge strategies can now take their own options
- Extend merge-subtree tests to test -Xsubtree=dir.
- Make "subtree" part more orthogonal to the rest of merge-recursive.
- Teach git-pull to pass -X<option> to git-merge
- git merge -X<option>
- git-merge-file --ours, --theirs
"git pull" patch needs sq-then-eval fix to protect it from $IFS
but otherwise seemed good.
^ permalink raw reply
* Re: [PATCH] mingw: disable Python
From: Johannes Sixt @ 2010-01-08 8:07 UTC (permalink / raw)
To: Erik Faye-Lund; +Cc: msysgit, git, Erik Faye-Lund
In-Reply-To: <1262902037-4420-1-git-send-email-kusmabite@gmail.com>
Erik Faye-Lund schrieb:
> Python is not commonly installed on Windows machines, so
> we should disable it there by default.
>
> --- a/Makefile
> +++ b/Makefile
> @@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
> + NO_PYTHON = YesPlease
I'm worried that with this solution it is impossible to re-enable Python
in config.mak (how do you undefine a Makefile variable?); it would be
necessary to hack Makefile.
Wouldn't it be superior to set
PYTHON_PATH =
in the MinGW section[*]. It works because there is this heuristic later:
ifeq ($(PYTHON_PATH),)
NO_PYTHON=NoThanks
endif
To enable Python, the user would have to set PYTHON_PATH in config.mak.
[I have only Python 1.6 to test (doh!), so I can only tell that it gets
used during 'make', but this fails due to missing modules, so I cannot
tell whether there would be a usable result if Python were sufficiently
recent.]
[*] You should probably set the MSVC section as well, even if you cannot
test it. The effect of the change is predictable enough, I think.
-- Hannes
^ permalink raw reply
* Re: [PATCH] mingw: disable Python
From: Johannes Schindelin @ 2010-01-08 10:35 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Erik Faye-Lund, msysgit, git, Erik Faye-Lund
In-Reply-To: <4B46E7D6.3080702@viscovery.net>
Hi,
On Fri, 8 Jan 2010, Johannes Sixt wrote:
> Erik Faye-Lund schrieb:
> > Python is not commonly installed on Windows machines, so
> > we should disable it there by default.
> >
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
> > + NO_PYTHON = YesPlease
>
> I'm worried that with this solution it is impossible to re-enable Python
> in config.mak (how do you undefine a Makefile variable?);
How about
NO_PYTHON=
in config.mak?
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] mingw: disable Python
From: Erik Faye-Lund @ 2010-01-08 10:49 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Johannes Sixt, msysgit, git
In-Reply-To: <alpine.DEB.1.00.1001081135180.4272@intel-tinevez-2-302>
On Fri, Jan 8, 2010 at 9:07 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Wouldn't it be superior to set
>
> PYTHON_PATH =
Yes, I think it would. I've tested it (I've got Python 2.6 installed
in c:\Python26\, so with your fix I can re-enable it by setting
"PYTHON_PATH=/c/Python26/python.exe" in config.mak.
On Fri, Jan 8, 2010 at 11:35 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Fri, 8 Jan 2010, Johannes Sixt wrote:
>
>> Erik Faye-Lund schrieb:
>> > Python is not commonly installed on Windows machines, so
>> > we should disable it there by default.
>> >
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
>> > + NO_PYTHON = YesPlease
>>
>> I'm worried that with this solution it is impossible to re-enable Python
>> in config.mak (how do you undefine a Makefile variable?);
> How about
>
> NO_PYTHON=
>
> in config.mak?
>
That doesn't work for me, at least not out of the box. NO_PYTHON is
still defined, it's just defined to an empty string. I guess we could
change to Makefile to accept empty NO_PYTHON as enabled, but since
Hannes' suggestion works fine, I think I'll stick with it, even if
it's a little inconsistent with the other stuff in the MinGW-section
of Makefile.
I'll resend a bit later.
--
Erik "kusma" Faye-Lund
^ permalink raw reply
* Re: [PATCH 1/5] MSVC: Windows-native implementation for subset of Pthreads API
From: Erik Faye-Lund @ 2010-01-08 10:58 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: Johannes Sixt, msysgit, git, Andrzej K. Haczewski
In-Reply-To: <20100108033232.GA28263@dpotapov.dyndns.org>
On Fri, Jan 8, 2010 at 4:32 AM, Dmitry Potapov <dpotapov@gmail.com> wrote:
> On Thu, Jan 07, 2010 at 10:54:57PM +0100, Johannes Sixt wrote:
>> +
>> +int pthread_cond_wait(pthread_cond_t *cond, CRITICAL_SECTION *mutex)
>> +{
>> + /* serialize access to waiters count */
>> + EnterCriticalSection(&cond->waiters_lock);
>> + ++cond->waiters;
>> + LeaveCriticalSection(&cond->waiters_lock);
>
> InterlockedIncrement(&cond->waiters);
>
>> +
>> + /*
>> + * Unlock external mutex and wait for signal.
>> + * NOTE: we've held mutex locked long enough to increment
>> + * waiters count above, so there's no problem with
>> + * leaving mutex unlocked before we wait on semaphore.
>> + */
>> + LeaveCriticalSection(mutex);
>> +
>> + /* let's wait - ignore return value */
>> + WaitForSingleObject(cond->sema, INFINITE);
>> +
>> + /* we're done waiting, so make sure we decrease waiters count */
>> + EnterCriticalSection(&cond->waiters_lock);
>> + --cond->waiters;
>> + LeaveCriticalSection(&cond->waiters_lock);
>
> InterlockedDecrement(&cond->waiters);
Nice.
>> +
>> + /* lock external mutex again */
>> + EnterCriticalSection(mutex);
>> +
>> + return 0;
>> +}
>> +
>> +int pthread_cond_signal(pthread_cond_t *cond)
>> +{
>> + int have_waiters;
>> +
>> + /* serialize access to waiters count */
>> + EnterCriticalSection(&cond->waiters_lock);
>> + have_waiters = cond->waiters > 0;
>> + LeaveCriticalSection(&cond->waiters_lock);
>
> AFAIK, Win32 API assumes that reading LONG is always atomic, so
> the critical section is not really necesary here, but you need
> to declare 'waiters' as 'volatile':
"Simple reads and writes to properly-aligned 32-bit variables are
atomic operations."
http://msdn.microsoft.com/en-us/library/ms684122(VS.85).aspx
In other words: Yes, you are right.
>> +
>> +int pthread_cond_init(pthread_cond_t *cond, const void *unused)
>> +{
>> + cond->waiters = 0;
>> +
>> + InitializeCriticalSection(&cond->waiters_lock);
>
> Is waiters_lock really necessary?
(Yeah, I moved this one to the end)
No, I think you've proven that it isn't.
--
Erik "kusma" Faye-Lund
^ permalink raw reply
* Re: Difference between pull --rebase and fetch+rebase
From: Santi Béjar @ 2010-01-08 11:05 UTC (permalink / raw)
To: martinvz; +Cc: git
In-Reply-To: <1262907485376-4269422.post@n2.nabble.com>
On Fri, Jan 8, 2010 at 12:38 AM, martinvz
<martin.von.zweigbergk@gmail.com> wrote:
>
>
> Santi Béjar-2 wrote:
>>
>> Can you provide, at least, a graph of your history (ala git log
>> --graph --oneline for example)? And plot also the reflog entries and
>> all the important commits.
>>
>
> $ git log --graph --format=%h --all
> * 2038a46 # topic-2
> * a7b93b2
> * f2501ae # origin/main
> * cd5aaa9
> * cb232f3
> ...
> * 5ed0d06
> * 3067862
> | * 6eba2fa # topic-1
> | * b09aaf4
> | * bc3b72a
> |/
> | * 03d0d84 # topic-3
> | * 5160773
> | * 3c25642
> |/
> | * 6e9b12b # topic-4
> | * 75f5ab2
> | * bdd08ce
> | * b5d5759
> |/
> * 486b580
> * a021696
> * 3ffe7df
> * d0f55c5
> ...
>
> I have topic-1 checked out and run "git pull" and expect it to rebase (only)
> commits bc3b72a, b09aaf4, 6eba2fa onto f2501ae, but it starts by applying
> a021696 and 486b580.
>
> $ git reflog -g origin/main
> f2501ae refs/remotes/origin/mai n@{0}: fetch origin: fast forward
> 3ffe7df refs/remotes/origin/mai n@{1}: fetch origin: fast forward
> ...
>
> I hope that's all that's all you need. It seems that the problem is that the
> oldremoteref gets overwritten with the entry from the reflog. Is the problem
> that 3ffe7df appears in the reflog or that 486b580 doesn't appear there? I'm
> not clear on what ends up in the reflog.
>
> I just realized that I myself created a021696 and 486b580 (but not 3ffe7df),
> probably by rebasing some now-dead branch against origin/main.
Yes, it is. The code expects that you always branch your topic
branches from the upstream branch, so all the possible fork points are
in the reflog. Your flow was to create the topic from a local commit
and then push that commit.
By the way, when Git tries to apply these two commits it should detect
that they are already applied so it should do nothing, isn't it?
HTH,
Santi
^ permalink raw reply
* Re: [StGit PATCH 2/2] Pass the --in-reply-to and --no-thread options to git send-email
From: Catalin Marinas @ 2010-01-08 12:33 UTC (permalink / raw)
To: Karl Wiberg; +Cc: git
In-Reply-To: <b8197bcb1001072243h24e6248er79ac5a8afb6e3782@mail.gmail.com>
2010/1/8 Karl Wiberg <kha@treskal.com>:
> On Thu, Jan 7, 2010 at 5:09 PM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>
>> + if options.in_reply_to:
>> + cmd.append("--in-reply-to %s" % options.in_reply_to)
>
> Have you tested this? I'm pretty sure you need "--in-reply-to=%s", or
> to add the two strings separately---since as far as I can see, this
> command is never shell-expanded.
I now tested it. I initially had an "=" before "%s" but dropped it
because git help wasn't clear whether it's needed. See below for an
updated patch:
Pass the --in-reply-to and --no-thread options to git send-email
From: Catalin Marinas <catalin.marinas@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
stgit/commands/mail.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index a78c9d2..287b6a4 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -241,6 +241,10 @@ def __send_message_git(msg, options):
cmd.append("--suppress-cc=self")
if not options.auto:
cmd.append("--suppress-cc=body")
+ if options.in_reply_to:
+ cmd.extend(["--in-reply-to", options.in_reply_to])
+ if options.no_thread:
+ cmd.append("--no-thread")
# We only support To/Cc/Bcc in git send-email for now.
for x in ['to', 'cc', 'bcc']:
^ permalink raw reply related
* [StGit PATCH 0/3] Support for command aliases
From: Catalin Marinas @ 2010-01-08 12:35 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
Hi,
These patches add support for StGit command aliases via
stgit.alias.<cmd> config options. They also re-add previously removed
commands (add, rm, resolved) and a new one (mv).
stg help lists the present aliases.
Catalin Marinas (3):
Populate the cached config options with the defaults
Add support for command aliases
Replace some git commands with stg aliases in test scripts
stgit/commands/__init__.py | 3 ++-
stgit/config.py | 37 +++++++++++++++++++++++--------------
stgit/main.py | 35 ++++++++++++++++++++++++++++++++++-
t/t0001-subdir-branches.sh | 2 +-
t/t0002-status.sh | 12 ++++++------
t/t1000-branch-create.sh | 4 ++--
t/t1002-branch-clone.sh | 2 +-
t/t1200-push-modified.sh | 2 +-
t/t1201-pull-trailing.sh | 2 +-
t/t1202-push-undo.sh | 6 +++---
t/t1203-push-conflict.sh | 6 +++---
t/t1204-pop-keep.sh | 2 +-
t/t1205-push-subdir.sh | 6 +++---
t/t1206-push-hidden.sh | 2 +-
t/t1207-push-tree.sh | 2 +-
t/t1300-uncommit.sh | 4 ++--
t/t1301-repair.sh | 8 ++++----
t/t1302-repair-interop.sh | 2 +-
t/t1500-float.sh | 14 +++++++-------
t/t1501-sink.sh | 12 ++++++------
t/t1600-delete-one.sh | 12 ++++++------
t/t1601-delete-many.sh | 2 +-
t/t1602-delete-spill.sh | 2 +-
t/t1700-goto-top.sh | 2 +-
t/t1701-goto-hidden.sh | 2 +-
t/t1800-import.sh | 4 ++--
t/t1900-mail.sh | 2 +-
t/t2000-sync.sh | 12 ++++++------
t/t2100-pull-policy-fetch.sh | 4 ++--
t/t2101-pull-policy-pull.sh | 6 +++---
t/t2102-pull-policy-rebase.sh | 4 ++--
t/t2200-rebase.sh | 4 ++--
t/t2300-refresh-subdir.sh | 4 ++--
t/t2400-diff.sh | 2 +-
t/t2500-clean.sh | 2 +-
t/t2600-squash.sh | 2 +-
t/t2700-refresh.sh | 6 +++---
t/t2701-refresh-p.sh | 4 ++--
t/t2702-refresh-rm.sh | 10 +++++-----
t/t2800-goto-subdir.sh | 2 +-
t/t3000-dirty-merge.sh | 2 +-
t/t3100-reset.sh | 2 +-
t/t3101-reset-hard.sh | 2 +-
t/t3102-undo.sh | 2 +-
t/t3103-undo-hard.sh | 2 +-
t/t3104-redo.sh | 2 +-
t/t3105-undo-external-mod.sh | 6 +++---
t/t3200-non-ascii-filenames.sh | 4 ++--
t/t3300-edit.sh | 2 +-
t/t3400-pick.sh | 8 ++++----
t/t4100-publish.sh | 12 ++++++------
51 files changed, 169 insertions(+), 126 deletions(-)
--
Catalin
^ permalink raw reply
* [StGit PATCH 1/3] Populate the cached config options with the defaults
From: Catalin Marinas @ 2010-01-08 12:35 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
In-Reply-To: <20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com>
The patch pre-populates the cached config options with the default
values. It also removes an unused option (stgit.extensions).
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
stgit/config.py | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/stgit/config.py b/stgit/config.py
index 796f2c9..811138d 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -28,16 +28,15 @@ class GitConfigException(StgException):
class GitConfig:
__defaults={
- 'stgit.smtpserver': 'localhost:25',
- 'stgit.smtpdelay': '5',
- 'stgit.pullcmd': 'git pull',
- 'stgit.fetchcmd': 'git fetch',
- 'stgit.pull-policy': 'pull',
- 'stgit.autoimerge': 'no',
- 'stgit.keepoptimized': 'no',
- 'stgit.extensions': '.ancestor .current .patched',
- 'stgit.shortnr': '5',
- 'stgit.pager': 'less'
+ 'stgit.smtpserver': ['localhost:25'],
+ 'stgit.smtpdelay': ['5'],
+ 'stgit.pullcmd': ['git pull'],
+ 'stgit.fetchcmd': ['git fetch'],
+ 'stgit.pull-policy': ['pull'],
+ 'stgit.autoimerge': ['no'],
+ 'stgit.keepoptimized': ['no'],
+ 'stgit.shortnr': ['5'],
+ 'stgit.pager': ['less']
}
__cache = None
@@ -47,7 +46,7 @@ class GitConfig:
done already."""
if self.__cache is not None:
return
- self.__cache = {}
+ self.__cache = self.__defaults
lines = Run('git', 'config', '--null', '--list'
).discard_exitcode().raw_output()
for line in filter(None, lines.split('\0')):
@@ -56,9 +55,10 @@ class GitConfig:
def get(self, name):
self.load()
- if name not in self.__cache:
- self.__cache[name] = [self.__defaults.get(name, None)]
- return self.__cache[name][-1]
+ try:
+ return self.__cache[name][-1]
+ except KeyError:
+ return None
def getall(self, name):
self.load()
^ permalink raw reply related
* [StGit PATCH 2/3] Add support for command aliases
From: Catalin Marinas @ 2010-01-08 12:36 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
In-Reply-To: <20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com>
This patch introduces support StGit command aliases with a few defaults:
stg add -> git add
stg rm -> git rm
stg mv -> git mv
stg resolved -> git add
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
stgit/commands/__init__.py | 3 ++-
stgit/config.py | 11 ++++++++++-
stgit/main.py | 35 ++++++++++++++++++++++++++++++++++-
3 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/stgit/commands/__init__.py b/stgit/commands/__init__.py
index f6cf3c3..f9de42b 100644
--- a/stgit/commands/__init__.py
+++ b/stgit/commands/__init__.py
@@ -28,7 +28,8 @@ def get_command(mod):
_kinds = [('repo', 'Repository commands'),
('stack', 'Stack (branch) commands'),
('patch', 'Patch commands'),
- ('wc', 'Index/worktree commands')]
+ ('wc', 'Index/worktree commands'),
+ ('alias', 'Alias commands')]
_kind_order = [kind for kind, desc in _kinds]
_kinds = dict(_kinds)
diff --git a/stgit/config.py b/stgit/config.py
index 811138d..dd194d3 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -36,7 +36,11 @@ class GitConfig:
'stgit.autoimerge': ['no'],
'stgit.keepoptimized': ['no'],
'stgit.shortnr': ['5'],
- 'stgit.pager': ['less']
+ 'stgit.pager': ['less'],
+ 'stgit.alias.add': ['git add'],
+ 'stgit.alias.rm': ['git rm'],
+ 'stgit.alias.mv': ['git mv'],
+ 'stgit.alias.resolved': ['git add']
}
__cache = None
@@ -76,6 +80,11 @@ class GitConfig:
else:
raise GitConfigException, 'Value for "%s" is not an integer: "%s"' % (name, value)
+ def getstartswith(self, name):
+ self.load()
+ return ((n, v[-1]) for (n, v) in self.__cache.iteritems()
+ if n.startswith(name))
+
def rename_section(self, from_name, to_name):
"""Rename a section in the config file. Silently do nothing if
the section doesn't exist."""
diff --git a/stgit/main.py b/stgit/main.py
index e324179..d5be70b 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -23,6 +23,30 @@ import sys, os, traceback
import stgit.commands
from stgit.out import *
from stgit import argparse, run, utils
+from stgit.config import config
+
+class CommandAlias(object):
+ def __init__(self, name, command):
+ self.__command = command
+ self.__name__ = name
+ self.usage = ['<arguments>']
+ self.help = 'Alias for "%s <arguments>".' % self.__command
+ self.options = []
+
+ def func(self, args):
+ cmd = self.__command.split() + args
+ p = run.Run(*cmd)
+ p.discard_exitcode().run()
+ return p.exitcode
+
+def is_cmd_alias(cmd):
+ return isinstance(cmd, CommandAlias)
+
+def append_alias_commands(cmd_list):
+ for (name, command) in config.getstartswith('stgit.alias.'):
+ name = utils.strip_prefix('stgit.alias.', name)
+ cmd_list[name] = (CommandAlias(name, command),
+ 'Alias commands', command)
#
# The commands map
@@ -49,9 +73,13 @@ class Commands(dict):
def __getitem__(self, key):
cmd_mod = self.get(key) or self.get(self.canonical_cmd(key))
- return stgit.commands.get_command(cmd_mod)
+ if is_cmd_alias(cmd_mod):
+ return cmd_mod
+ else:
+ return stgit.commands.get_command(cmd_mod)
cmd_list = stgit.commands.get_commands()
+append_alias_commands(cmd_list)
commands = Commands((cmd, mod) for cmd, (mod, kind, help)
in cmd_list.iteritems())
@@ -100,6 +128,8 @@ def _main():
sys.argv[0] += ' %s' % cmd
command = commands[cmd]
parser = argparse.make_option_parser(command)
+ if is_cmd_alias(command):
+ parser.remove_option('-h')
from pydoc import pager
pager(parser.format_help())
else:
@@ -121,6 +151,9 @@ def _main():
del(sys.argv[1])
command = commands[cmd]
+ if is_cmd_alias(command):
+ sys.exit(command.func(sys.argv[1:]))
+
parser = argparse.make_option_parser(command)
options, args = parser.parse_args()
directory = command.directory
^ permalink raw reply related
* [StGit PATCH 3/3] Replace some git commands with stg aliases in test scripts
From: Catalin Marinas @ 2010-01-08 12:36 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
In-Reply-To: <20100108123403.24161.3495.stgit@pc1117.cambridge.arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
t/t0001-subdir-branches.sh | 2 +-
t/t0002-status.sh | 12 ++++++------
t/t1000-branch-create.sh | 4 ++--
t/t1002-branch-clone.sh | 2 +-
t/t1200-push-modified.sh | 2 +-
t/t1201-pull-trailing.sh | 2 +-
t/t1202-push-undo.sh | 6 +++---
t/t1203-push-conflict.sh | 6 +++---
t/t1204-pop-keep.sh | 2 +-
t/t1205-push-subdir.sh | 6 +++---
t/t1206-push-hidden.sh | 2 +-
t/t1207-push-tree.sh | 2 +-
t/t1300-uncommit.sh | 4 ++--
t/t1301-repair.sh | 8 ++++----
t/t1302-repair-interop.sh | 2 +-
t/t1500-float.sh | 14 +++++++-------
t/t1501-sink.sh | 12 ++++++------
t/t1600-delete-one.sh | 12 ++++++------
t/t1601-delete-many.sh | 2 +-
t/t1602-delete-spill.sh | 2 +-
t/t1700-goto-top.sh | 2 +-
t/t1701-goto-hidden.sh | 2 +-
t/t1800-import.sh | 4 ++--
t/t1900-mail.sh | 2 +-
t/t2000-sync.sh | 12 ++++++------
t/t2100-pull-policy-fetch.sh | 4 ++--
t/t2101-pull-policy-pull.sh | 6 +++---
t/t2102-pull-policy-rebase.sh | 4 ++--
t/t2200-rebase.sh | 4 ++--
t/t2300-refresh-subdir.sh | 4 ++--
t/t2400-diff.sh | 2 +-
t/t2500-clean.sh | 2 +-
t/t2600-squash.sh | 2 +-
t/t2700-refresh.sh | 6 +++---
t/t2701-refresh-p.sh | 4 ++--
t/t2702-refresh-rm.sh | 10 +++++-----
t/t2800-goto-subdir.sh | 2 +-
t/t3000-dirty-merge.sh | 2 +-
t/t3100-reset.sh | 2 +-
t/t3101-reset-hard.sh | 2 +-
t/t3102-undo.sh | 2 +-
t/t3103-undo-hard.sh | 2 +-
t/t3104-redo.sh | 2 +-
t/t3105-undo-external-mod.sh | 6 +++---
t/t3200-non-ascii-filenames.sh | 4 ++--
t/t3300-edit.sh | 2 +-
t/t3400-pick.sh | 8 ++++----
t/t4100-publish.sh | 12 ++++++------
48 files changed, 110 insertions(+), 110 deletions(-)
diff --git a/t/t0001-subdir-branches.sh b/t/t0001-subdir-branches.sh
index 3f7962a..5ea787e 100755
--- a/t/t0001-subdir-branches.sh
+++ b/t/t0001-subdir-branches.sh
@@ -14,7 +14,7 @@ containing slashes (that is, branches living in a subdirectory of
test_expect_success 'Create a patch' \
'stg init &&
echo "foo" > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg new foo -m "Add foo.txt" &&
stg refresh'
diff --git a/t/t0002-status.sh b/t/t0002-status.sh
index 2512c53..c978845 100755
--- a/t/t0002-status.sh
+++ b/t/t0002-status.sh
@@ -54,7 +54,7 @@ cat > expected.txt <<EOF
A foo/bar
EOF
test_expect_success 'Status with an added file' '
- git add foo &&
+ stg add foo &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
@@ -95,7 +95,7 @@ test_expect_success 'Status after refresh' '
test_expect_success 'Add another file' '
echo lajbans > fie &&
- git add fie &&
+ stg add fie &&
stg refresh
'
@@ -145,7 +145,7 @@ A fie
M foo/bar
EOF
test_expect_success 'Status after resolving the push' '
- git add --update &&
+ stg add --update &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
@@ -166,7 +166,7 @@ EOF
test_expect_success 'Status of disappeared newborn' '
stg refresh &&
touch foo/bar &&
- git add foo/bar &&
+ stg add foo/bar &&
rm foo/bar &&
stg status > output.txt &&
test_cmp expected.txt output.txt
@@ -177,8 +177,8 @@ A fay
D fie
EOF
test_expect_success 'Status after renaming a file' '
- git rm foo/bar &&
- git mv fie fay &&
+ stg rm foo/bar &&
+ stg mv fie fay &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
diff --git a/t/t1000-branch-create.sh b/t/t1000-branch-create.sh
index 3fff3ee..2626c73 100755
--- a/t/t1000-branch-create.sh
+++ b/t/t1000-branch-create.sh
@@ -78,9 +78,9 @@ test_expect_success \
'Setup two commits including removal of generated files' '
git init &&
touch file1 file2 &&
- git add file1 file2 &&
+ stg add file1 file2 &&
git commit -m 1 &&
- git rm file1 file2 &&
+ stg rm file1 file2 &&
git commit -m 2 &&
touch file2
'
diff --git a/t/t1002-branch-clone.sh b/t/t1002-branch-clone.sh
index 1303b41..4930c20 100755
--- a/t/t1002-branch-clone.sh
+++ b/t/t1002-branch-clone.sh
@@ -14,7 +14,7 @@ test_expect_success \
'Create a GIT commit' \
'
echo bar > bar.txt &&
- git add bar.txt &&
+ stg add bar.txt &&
git commit -a -m bar
'
diff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh
index 2077492..e04dac5 100755
--- a/t/t1200-push-modified.sh
+++ b/t/t1200-push-modified.sh
@@ -23,7 +23,7 @@ test_expect_success \
stg clone foo bar &&
(
cd bar && stg new p1 -m p1 &&
- printf "a\nc\n" > file && git add file && stg refresh &&
+ printf "a\nc\n" > file && stg add file && stg refresh &&
stg new p2 -m p2 &&
printf "a\nb\nc\n" > file && stg refresh &&
[ "$(echo $(stg series --applied --noprefix))" = "p1 p2" ] &&
diff --git a/t/t1201-pull-trailing.sh b/t/t1201-pull-trailing.sh
index d66ad26..a993aeb 100755
--- a/t/t1201-pull-trailing.sh
+++ b/t/t1201-pull-trailing.sh
@@ -18,7 +18,7 @@ test_create_repo foo
test_expect_success \
'Setup and clone tree, and setup changes' \
"(cd foo &&
- printf 'a\nb\n' > file && git add file && git commit -m .
+ printf 'a\nb\n' > file && stg add file && git commit -m .
) &&
stg clone foo bar &&
(cd bar && stg new p1 -m p1
diff --git a/t/t1202-push-undo.sh b/t/t1202-push-undo.sh
index 14a3d6d..5afcf68 100755
--- a/t/t1202-push-undo.sh
+++ b/t/t1202-push-undo.sh
@@ -21,7 +21,7 @@ test_expect_success \
'
stg new foo -m foo &&
echo foo > test &&
- git add test &&
+ stg add test &&
stg refresh
'
@@ -30,7 +30,7 @@ test_expect_success \
'
stg new bar -m bar &&
echo bar > test &&
- git add test &&
+ stg add test &&
stg refresh
'
@@ -62,7 +62,7 @@ test_expect_success \
'Undo with disappeared newborn' \
'
touch newfile &&
- git add newfile &&
+ stg add newfile &&
rm newfile &&
stg undo --hard
'
diff --git a/t/t1203-push-conflict.sh b/t/t1203-push-conflict.sh
index 8027e6c..b759298 100755
--- a/t/t1203-push-conflict.sh
+++ b/t/t1203-push-conflict.sh
@@ -21,7 +21,7 @@ test_expect_success \
stg new foo -m foo &&
echo foo > test &&
echo fie > test2 &&
- git add test test2 &&
+ stg add test test2 &&
stg refresh &&
stg pop
'
@@ -31,7 +31,7 @@ test_expect_success \
'
stg new bar -m bar &&
echo bar > test &&
- git add test &&
+ stg add test &&
stg refresh
'
@@ -63,7 +63,7 @@ test_expect_success \
'Resolve the conflict' \
'
echo resolved > test &&
- git add test &&
+ stg resolved test &&
stg refresh
'
diff --git a/t/t1204-pop-keep.sh b/t/t1204-pop-keep.sh
index db473f2..ee5d058 100755
--- a/t/t1204-pop-keep.sh
+++ b/t/t1204-pop-keep.sh
@@ -8,7 +8,7 @@ test_expect_success 'Create a few patches' '
for i in 0 1 2; do
stg new p$i -m p$i &&
echo "patch$i" >> patch$i.txt &&
- git add patch$i.txt &&
+ stg add patch$i.txt &&
stg refresh
done &&
[ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2" ] &&
diff --git a/t/t1205-push-subdir.sh b/t/t1205-push-subdir.sh
index 2d5918b..4af63ce 100755
--- a/t/t1205-push-subdir.sh
+++ b/t/t1205-push-subdir.sh
@@ -9,7 +9,7 @@ test_expect_success 'Create some patches' '
stg new p$i -m p$i &&
echo x$i >> x.txt &&
echo y$i >> foo/y.txt &&
- git add x.txt foo/y.txt &&
+ stg add x.txt foo/y.txt &&
stg refresh
done &&
[ "$(echo $(stg series --applied --noprefix))" = "p0 p1 p2" ] &&
@@ -33,7 +33,7 @@ test_expect_success 'Modifying push from a subdir' '
[ "$(echo $(cat foo/y.txt))" = "y0 y1" ] &&
stg new extra -m extra &&
echo extra >> extra.txt &&
- git add extra.txt &&
+ stg add extra.txt &&
stg refresh &&
cd foo &&
stg push &&
@@ -57,7 +57,7 @@ test_expect_success 'Conflicting add/unknown file in subdir' '
stg new foo -m foo &&
mkdir d &&
echo foo > d/test &&
- git add d/test &&
+ stg add d/test &&
stg refresh &&
stg pop &&
mkdir -p d &&
diff --git a/t/t1206-push-hidden.sh b/t/t1206-push-hidden.sh
index 20aa306..ee8e254 100755
--- a/t/t1206-push-hidden.sh
+++ b/t/t1206-push-hidden.sh
@@ -7,7 +7,7 @@ test_description='Test "stg push" with hidden patches'
test_expect_success 'Initialize StGit stack' '
stg init &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg new -m hidden-patch &&
stg refresh &&
stg pop &&
diff --git a/t/t1207-push-tree.sh b/t/t1207-push-tree.sh
index 9d0b1cc..e97cb1b 100755
--- a/t/t1207-push-tree.sh
+++ b/t/t1207-push-tree.sh
@@ -12,7 +12,7 @@ test_expect_success \
stg init &&
stg new A -m A &&
echo hello world > a &&
- git add a &&
+ stg add a &&
stg refresh
stg new B -m B &&
echo HELLO WORLD > a &&
diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh
index 43e0d04..5e9b8fb 100755
--- a/t/t1300-uncommit.sh
+++ b/t/t1300-uncommit.sh
@@ -19,7 +19,7 @@ test_expect_success \
'
stg new foo -m "Foo Patch" &&
echo foo > test &&
- git add test &&
+ stg add test &&
stg refresh
'
@@ -28,7 +28,7 @@ test_expect_success \
'
stg new bar -m "Bar Patch" &&
echo bar > test &&
- git add test &&
+ stg add test &&
stg refresh
'
diff --git a/t/t1301-repair.sh b/t/t1301-repair.sh
index 8d5d4e5..939699c 100755
--- a/t/t1301-repair.sh
+++ b/t/t1301-repair.sh
@@ -20,7 +20,7 @@ test_expect_success \
'
stg new foo -m foo &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh
'
@@ -32,7 +32,7 @@ test_expect_success \
'Create a GIT commit' \
'
echo bar > bar.txt &&
- git add bar.txt &&
+ stg add bar.txt &&
git commit -a -m bar
'
@@ -46,7 +46,7 @@ test_expect_success \
'Create three more GIT commits' \
'
echo one > numbers.txt &&
- git add numbers.txt &&
+ stg add numbers.txt &&
git commit -a -m one &&
echo two >> numbers.txt &&
git commit -a -m two &&
@@ -65,7 +65,7 @@ test_expect_success \
'
git checkout -b br master^^ &&
echo woof > woof.txt &&
- git add woof.txt &&
+ stg add woof.txt &&
git commit -a -m woof &&
git checkout master &&
git pull . br
diff --git a/t/t1302-repair-interop.sh b/t/t1302-repair-interop.sh
index 9fad3fa..cce3cf1 100755
--- a/t/t1302-repair-interop.sh
+++ b/t/t1302-repair-interop.sh
@@ -4,7 +4,7 @@ test_description='Test git/StGit interoperability with "stg repair"'
test_expect_success 'Create some git-only history' '
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
git commit -a -m foo &&
git tag foo-tag &&
for i in 0 1 2 3 4; do
diff --git a/t/t1500-float.sh b/t/t1500-float.sh
index e44af3a..0ed5733 100755
--- a/t/t1500-float.sh
+++ b/t/t1500-float.sh
@@ -12,13 +12,13 @@ test_description='Test floating a number of patches to the top of the stack
test_expect_success \
'Initialize the StGIT repository' \
'stg init &&
- stg new A -m "a" && echo A >a.txt && git add a.txt && stg refresh &&
- stg new B -m "b" && echo B >b.txt && git add b.txt && stg refresh &&
- stg new C -m "c" && echo C >c.txt && git add c.txt && stg refresh &&
- stg new D -m "d" && echo D >d.txt && git add d.txt && stg refresh &&
- stg new E -m "e" && echo E >e.txt && git add e.txt && stg refresh &&
- stg new F -m "f" && echo F >f.txt && git add f.txt && stg refresh &&
- stg new G -m "g" && echo G >g.txt && git add g.txt && stg refresh &&
+ stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh &&
+ stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh &&
+ stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh &&
+ stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh &&
+ stg new E -m "e" && echo E >e.txt && stg add e.txt && stg refresh &&
+ stg new F -m "f" && echo F >f.txt && stg add f.txt && stg refresh &&
+ stg new G -m "g" && echo G >g.txt && stg add g.txt && stg refresh &&
stg pop &&
test "$(echo $(stg series --applied --noprefix))" = "A B C D E F"
'
diff --git a/t/t1501-sink.sh b/t/t1501-sink.sh
index a0769dd..e2c65cb 100755
--- a/t/t1501-sink.sh
+++ b/t/t1501-sink.sh
@@ -6,22 +6,22 @@ test_description='Test "stg sink"'
test_expect_success 'Initialize StGit stack' '
echo 0 >> f0 &&
- git add f0 &&
+ stg add f0 &&
git commit -m initial &&
echo 1 >> f1 &&
- git add f1 &&
+ stg add f1 &&
git commit -m p1 &&
echo 2 >> f2 &&
- git add f2 &&
+ stg add f2 &&
git commit -m p2 &&
echo 3 >> f3 &&
- git add f3 &&
+ stg add f3 &&
git commit -m p3 &&
echo 4 >> f4 &&
- git add f4 &&
+ stg add f4 &&
git commit -m p4 &&
echo 22 >> f2 &&
- git add f2 &&
+ stg add f2 &&
git commit -m p22 &&
stg init &&
stg uncommit p22 p4 p3 p2 p1 &&
diff --git a/t/t1600-delete-one.sh b/t/t1600-delete-one.sh
index ef0b29d..f55bad6 100755
--- a/t/t1600-delete-one.sh
+++ b/t/t1600-delete-one.sh
@@ -12,7 +12,7 @@ test_expect_success \
'
stg new foo -m foo &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh
'
@@ -47,7 +47,7 @@ test_expect_success \
'
stg new foo -m foo &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh &&
stg pop
'
@@ -65,11 +65,11 @@ test_expect_success \
'
stg new foo -m foo &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh &&
stg new bar -m bar &&
echo bar > bar.txt &&
- git add bar.txt &&
+ stg add bar.txt &&
stg refresh
'
@@ -87,12 +87,12 @@ test_expect_success \
stg branch --create br &&
stg new baz -m baz &&
echo baz > baz.txt &&
- git add baz.txt &&
+ stg add baz.txt &&
stg refresh &&
stg branch master &&
stg new baz -m baz &&
echo baz > baz.txt &&
- git add baz.txt &&
+ stg add baz.txt &&
stg refresh
'
diff --git a/t/t1601-delete-many.sh b/t/t1601-delete-many.sh
index cb7fb0d..a0818b3 100755
--- a/t/t1601-delete-many.sh
+++ b/t/t1601-delete-many.sh
@@ -12,7 +12,7 @@ test_expect_success \
'
stg new p0 -m p0 &&
echo p0 > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh &&
for i in 1 2 3 4 5 6 7 8 9; do
stg new p$i -m p$i &&
diff --git a/t/t1602-delete-spill.sh b/t/t1602-delete-spill.sh
index 1ddec53..3e27598 100755
--- a/t/t1602-delete-spill.sh
+++ b/t/t1602-delete-spill.sh
@@ -9,7 +9,7 @@ test_expect_success 'Initialize the StGIT repository' '
test_expect_success 'Create five applied and three unapplied patches' '
for i in 0 1 2 3 4 5 6 7; do
echo $i >> foo &&
- git add foo &&
+ stg add foo &&
git commit -m p$i
done
stg uncommit -n 8 &&
diff --git a/t/t1700-goto-top.sh b/t/t1700-goto-top.sh
index 8f2d44a..618ebc7 100755
--- a/t/t1700-goto-top.sh
+++ b/t/t1700-goto-top.sh
@@ -19,7 +19,7 @@ test_expect_success \
'
stg new foo -m "Foo Patch" &&
echo foo > test &&
- git add test &&
+ stg add test &&
stg refresh
'
diff --git a/t/t1701-goto-hidden.sh b/t/t1701-goto-hidden.sh
index a3c6e62..19ab703 100755
--- a/t/t1701-goto-hidden.sh
+++ b/t/t1701-goto-hidden.sh
@@ -7,7 +7,7 @@ test_description='Test "stg goto" with hidden patches'
test_expect_success 'Initialize StGit stack' '
stg init &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg new -m hidden-patch &&
stg refresh &&
stg pop &&
diff --git a/t/t1800-import.sh b/t/t1800-import.sh
index 93de794..406a6cf 100755
--- a/t/t1800-import.sh
+++ b/t/t1800-import.sh
@@ -7,7 +7,7 @@ test_expect_success \
'Initialize the StGIT repository' \
'
cp ../t1800-import/foo.txt . &&
- git add foo.txt &&
+ stg add foo.txt &&
git commit -a -m "initial version" &&
stg init
'
@@ -164,7 +164,7 @@ test_expect_success \
'apply a series from a tarball' \
'
rm -f jabberwocky.txt && touch jabberwocky.txt &&
- git add jabberwocky.txt && git commit -m "empty file" jabberwocky.txt &&
+ stg add jabberwocky.txt && git commit -m "empty file" jabberwocky.txt &&
(cd ../t1800-import; tar -cjf jabberwocky.tar.bz2 patches) &&
stg import --series ../t1800-import/jabberwocky.tar.bz2
[ $(git cat-file -p $(stg id) \
diff --git a/t/t1900-mail.sh b/t/t1900-mail.sh
index cea6769..acb61a7 100755
--- a/t/t1900-mail.sh
+++ b/t/t1900-mail.sh
@@ -10,7 +10,7 @@ test_expect_success \
for i in 1 2 3 4 5; do
touch foo.txt &&
echo "line $i" >> foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
git commit -a -m "Patch $i"
done &&
stg init &&
diff --git a/t/t2000-sync.sh b/t/t2000-sync.sh
index d550538..696d698 100755
--- a/t/t2000-sync.sh
+++ b/t/t2000-sync.sh
@@ -18,15 +18,15 @@ test_expect_success \
'
stg new p1 -m p1 &&
echo foo1 > foo1.txt &&
- git add foo1.txt &&
+ stg add foo1.txt &&
stg refresh &&
stg new p2 -m p2 &&
echo foo2 > foo2.txt &&
- git add foo2.txt &&
+ stg add foo2.txt &&
stg refresh &&
stg new p3 -m p3 &&
echo foo3 > foo3.txt &&
- git add foo3.txt &&
+ stg add foo3.txt &&
stg refresh &&
stg export &&
stg pop &&
@@ -86,7 +86,7 @@ test_expect_success \
stg refresh &&
stg goto p2 &&
echo bar2 > bar2.txt &&
- git add bar2.txt &&
+ stg add bar2.txt &&
stg refresh &&
stg goto p3 &&
echo bar3 >> foo3.txt &&
@@ -117,7 +117,7 @@ test_expect_success \
'
[ "$(echo $(stg series --applied --noprefix))" = "p1" ] &&
[ "$(echo $(stg series --unapplied --noprefix))" = "p2 p3" ] &&
- git add --update &&
+ stg add --update &&
stg refresh &&
stg goto p3
[ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
@@ -135,7 +135,7 @@ test_expect_success \
'
[ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
[ "$(echo $(stg series --unapplied --noprefix))" = "" ] &&
- git add --update &&
+ stg add --update &&
stg refresh &&
[ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
[ "$(echo $(stg series --unapplied --noprefix))" = "" ]
diff --git a/t/t2100-pull-policy-fetch.sh b/t/t2100-pull-policy-fetch.sh
index 670c7c6..07435f5 100755
--- a/t/t2100-pull-policy-fetch.sh
+++ b/t/t2100-pull-policy-fetch.sh
@@ -22,7 +22,7 @@ test_expect_success \
git config branch.master.stgit.pull-policy fetch-rebase &&
git config --list &&
stg new c1 -m c1 &&
- echo a > file && git add file && stg refresh
+ echo a > file && stg add file && stg refresh
)
'
@@ -30,7 +30,7 @@ test_expect_success \
'Add non-rewinding commit upstream and pull it from clone' \
'
(cd upstream && stg new u1 -m u1 &&
- echo a > file2 && git add file2 && stg refresh) &&
+ echo a > file2 && stg add file2 && stg refresh) &&
(cd clone && stg pull) &&
test -e clone/file2
'
diff --git a/t/t2101-pull-policy-pull.sh b/t/t2101-pull-policy-pull.sh
index 777ccb5..35c15ad 100755
--- a/t/t2101-pull-policy-pull.sh
+++ b/t/t2101-pull-policy-pull.sh
@@ -22,7 +22,7 @@ test_expect_success \
git config branch.master.stgit.pull-policy pull &&
git config --list &&
stg new c1 -m c1 &&
- echo a > file && git add file && stg refresh
+ echo a > file && stg add file && stg refresh
)
'
@@ -30,7 +30,7 @@ test_expect_success \
'Add non-rewinding commit upstream and pull it from clone' \
'
(cd upstream && stg new u1 -m u1 &&
- echo a > file2 && git add file2 && stg refresh) &&
+ echo a > file2 && stg add file2 && stg refresh) &&
(cd clone && stg pull) &&
test -e clone/file2
'
@@ -49,7 +49,7 @@ test_expect_success \
test_expect_success \
'"Solve" the conflict (pretend there is none)' \
'(cd clone &&
- git add file2 && EDITOR=cat git commit)'
+ stg add file2 && EDITOR=cat git commit)'
test_expect_success \
'Push the stack back' \
diff --git a/t/t2102-pull-policy-rebase.sh b/t/t2102-pull-policy-rebase.sh
index 5619bda..952ee7e 100755
--- a/t/t2102-pull-policy-rebase.sh
+++ b/t/t2102-pull-policy-rebase.sh
@@ -16,14 +16,14 @@ test_expect_success \
git config branch.stack.stgit.pull-policy rebase &&
git config --list &&
stg new c1 -m c1 &&
- echo a > file && git add file && stg refresh
+ echo a > file && stg add file && stg refresh
'
test_expect_success \
'Add non-rewinding commit in parent and pull the stack' \
'
stg branch parent && stg new u1 -m u1 &&
- echo b > file2 && git add file2 && stg refresh &&
+ echo b > file2 && stg add file2 && stg refresh &&
stg branch stack && stg pull &&
test -e file2
'
diff --git a/t/t2200-rebase.sh b/t/t2200-rebase.sh
index adbf242..75e1f17 100755
--- a/t/t2200-rebase.sh
+++ b/t/t2200-rebase.sh
@@ -11,10 +11,10 @@ test_expect_success \
'Setup a multi-commit branch and fork an stgit stack' \
'
echo foo > file1 &&
- git add file1 &&
+ stg add file1 &&
git commit -m a &&
echo foo > file2 &&
- git add file2 &&
+ stg add file2 &&
git commit -m b &&
stg branch --create stack &&
diff --git a/t/t2300-refresh-subdir.sh b/t/t2300-refresh-subdir.sh
index 89c95db..34d6e69 100755
--- a/t/t2300-refresh-subdir.sh
+++ b/t/t2300-refresh-subdir.sh
@@ -8,7 +8,7 @@ test_expect_success 'Refresh from a subdirectory' '
echo foo >> foo.txt &&
mkdir bar &&
echo bar >> bar/bar.txt &&
- git add foo.txt bar/bar.txt &&
+ stg add foo.txt bar/bar.txt &&
cd bar &&
stg refresh &&
cd .. &&
@@ -48,7 +48,7 @@ test_expect_success 'Refresh subdirectories recursively' '
test_expect_success 'refresh -u' '
echo baz >> bar/baz.txt &&
stg new p1 -m p1 &&
- git add bar/baz.txt &&
+ stg add bar/baz.txt &&
stg refresh --index &&
echo xyzzy >> foo.txt &&
echo xyzzy >> bar/bar.txt &&
diff --git a/t/t2400-diff.sh b/t/t2400-diff.sh
index fbcefe1..73f4539 100755
--- a/t/t2400-diff.sh
+++ b/t/t2400-diff.sh
@@ -10,7 +10,7 @@ test_expect_success 'Diff with no StGit data' '
test_expect_success 'Make some local changes' '
echo foo >> foo.txt &&
- git add foo.txt
+ stg add foo.txt
'
test_expect_success 'Diff with some local changes' '
diff --git a/t/t2500-clean.sh b/t/t2500-clean.sh
index 7f821f5..8082c21 100755
--- a/t/t2500-clean.sh
+++ b/t/t2500-clean.sh
@@ -9,7 +9,7 @@ test_expect_success 'Initialize StGit stack' '
stg new e0 -m e0 &&
stg new p0 -m p0 &&
echo foo > foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh &&
stg new e1 -m e1 &&
stg new e2 -m e2 &&
diff --git a/t/t2600-squash.sh b/t/t2600-squash.sh
index 3dba012..e36a638 100755
--- a/t/t2600-squash.sh
+++ b/t/t2600-squash.sh
@@ -9,7 +9,7 @@ test_expect_success 'Initialize StGit stack' '
for i in 0 1 2 3; do
stg new p$i -m "foo $i" &&
echo "foo $i" >> foo.txt &&
- git add foo.txt &&
+ stg add foo.txt &&
stg refresh
done
'
diff --git a/t/t2700-refresh.sh b/t/t2700-refresh.sh
index aad6d45..6028b9e 100755
--- a/t/t2700-refresh.sh
+++ b/t/t2700-refresh.sh
@@ -13,7 +13,7 @@ test_expect_success 'Initialize StGit stack' '
stg new p0 -m "base" &&
for i in 1 2 3; do
echo base >> foo$i.txt &&
- git add foo$i.txt
+ stg add foo$i.txt
done
stg refresh &&
for i in 1 2 3; do
@@ -104,7 +104,7 @@ test_expect_success 'Refresh --index' '
stg status &&
stg new p4 -m "refresh_index" &&
echo baz 1 >> foo1.txt &&
- git add foo1.txt &&
+ stg add foo1.txt &&
echo blah 1 >> foo1.txt &&
echo baz 2 >> foo2.txt &&
stg refresh --index &&
@@ -119,7 +119,7 @@ test_expect_success 'Refresh --index' '
'
test_expect_success 'Refresh moved files' '
- git mv foo1.txt foo1-new.txt &&
+ stg mv foo1.txt foo1-new.txt &&
stg refresh
'
diff --git a/t/t2701-refresh-p.sh b/t/t2701-refresh-p.sh
index ed4bac4..3ba3b02 100755
--- a/t/t2701-refresh-p.sh
+++ b/t/t2701-refresh-p.sh
@@ -15,7 +15,7 @@ test_expect_success 'Initialize StGit stack' '
stg init &&
for i in 1 2; do
echo x > $i.txt &&
- git add $i.txt &&
+ stg add $i.txt &&
stg new p$i -m "Patch $i" &&
stg refresh
done
@@ -33,7 +33,7 @@ test_expect_success 'Add new file to non-top patch' '
stg status > status1.txt &&
test_cmp expected0.txt status1.txt &&
echo y > new.txt &&
- git add new.txt &&
+ stg add new.txt &&
stg refresh -p p1 &&
stg status > status2.txt &&
test_cmp expected0.txt status2.txt &&
diff --git a/t/t2702-refresh-rm.sh b/t/t2702-refresh-rm.sh
index 0362cc6..fa81cee 100755
--- a/t/t2702-refresh-rm.sh
+++ b/t/t2702-refresh-rm.sh
@@ -20,7 +20,7 @@ test_expect_success 'Initialize StGit stack' '
stg init &&
echo x > x.txt &&
echo y > y.txt &&
- git add x.txt y.txt &&
+ stg add x.txt y.txt &&
git commit -m "Add some files"
'
@@ -28,9 +28,9 @@ cat > expected0.txt <<EOF
D y.txt
EOF
printf '' > expected1.txt
-test_expect_success 'git rm a file' '
+test_expect_success 'stg rm a file' '
stg new -m p0 &&
- git rm y.txt &&
+ stg rm y.txt &&
stg status > status0.txt &&
test_cmp expected0.txt status0.txt &&
stg refresh &&
@@ -47,10 +47,10 @@ D y.txt
M x.txt
EOF
printf '' > expected1.txt
-test_expect_success 'git rm a file together with other changes' '
+test_expect_success 'stg rm a file together with other changes' '
stg new -m p1 &&
echo x2 >> x.txt &&
- git rm y.txt &&
+ stg rm y.txt &&
stg status > status0.txt &&
test_cmp expected0.txt status0.txt &&
stg refresh &&
diff --git a/t/t2800-goto-subdir.sh b/t/t2800-goto-subdir.sh
index 5960bd6..5ac77cc 100755
--- a/t/t2800-goto-subdir.sh
+++ b/t/t2800-goto-subdir.sh
@@ -13,7 +13,7 @@ test_expect_success 'Initialize StGit stack' '
for i in 1 2 3; do
echo foo$i >> foo/bar &&
stg new p$i -m p$i &&
- git add foo/bar &&
+ stg add foo/bar &&
stg refresh
done
'
diff --git a/t/t3000-dirty-merge.sh b/t/t3000-dirty-merge.sh
index 419d86e..d8c16fa 100755
--- a/t/t3000-dirty-merge.sh
+++ b/t/t3000-dirty-merge.sh
@@ -7,7 +7,7 @@ test_description='Try a push that requires merging a file that is dirty'
test_expect_success 'Initialize StGit stack with two patches' '
stg init &&
touch a &&
- git add a &&
+ stg add a &&
git commit -m a &&
echo 1 > a &&
git commit -a -m p1 &&
diff --git a/t/t3100-reset.sh b/t/t3100-reset.sh
index 3024975..61f303d 100755
--- a/t/t3100-reset.sh
+++ b/t/t3100-reset.sh
@@ -12,7 +12,7 @@ EOF
test_expect_success 'Initialize StGit stack with three patches' '
stg init &&
echo 000 >> a &&
- git add a &&
+ stg add a &&
git commit -m a &&
echo 111 >> a &&
git commit -a -m p1 &&
diff --git a/t/t3101-reset-hard.sh b/t/t3101-reset-hard.sh
index 45e86dc..a93682b 100755
--- a/t/t3101-reset-hard.sh
+++ b/t/t3101-reset-hard.sh
@@ -13,7 +13,7 @@ EOF
test_expect_success 'Initialize StGit stack with three patches' '
stg init &&
echo 000 >> a &&
- git add a &&
+ stg add a &&
git commit -m a &&
echo 111 >> a &&
git commit -a -m p1 &&
diff --git a/t/t3102-undo.sh b/t/t3102-undo.sh
index 9373522..010a63d 100755
--- a/t/t3102-undo.sh
+++ b/t/t3102-undo.sh
@@ -12,7 +12,7 @@ EOF
test_expect_success 'Initialize StGit stack with three patches' '
stg init &&
echo 000 >> a &&
- git add a &&
+ stg add a &&
git commit -m a &&
echo 111 >> a &&
git commit -a -m p1 &&
diff --git a/t/t3103-undo-hard.sh b/t/t3103-undo-hard.sh
index df14b1f..b94543e 100755
--- a/t/t3103-undo-hard.sh
+++ b/t/t3103-undo-hard.sh
@@ -13,7 +13,7 @@ EOF
test_expect_success 'Initialize StGit stack with three patches' '
stg init &&
echo 000 >> a &&
- git add a &&
+ stg add a &&
git commit -m a &&
echo 111 >> a &&
git commit -a -m p1 &&
diff --git a/t/t3104-redo.sh b/t/t3104-redo.sh
index 030311d..3d3c617 100755
--- a/t/t3104-redo.sh
+++ b/t/t3104-redo.sh
@@ -12,7 +12,7 @@ EOF
test_expect_success 'Initialize StGit stack with three patches' '
stg init &&
echo 000 >> a &&
- git add a &&
+ stg add a &&
git commit -m a &&
echo 111 >> a &&
git commit -a -m p1 &&
diff --git a/t/t3105-undo-external-mod.sh b/t/t3105-undo-external-mod.sh
index f5aad64..1980167 100755
--- a/t/t3105-undo-external-mod.sh
+++ b/t/t3105-undo-external-mod.sh
@@ -13,10 +13,10 @@ EOF
test_expect_success 'Initialize StGit stack' '
stg init &&
echo 000 >> a &&
- git add a &&
+ stg add a &&
git commit -m p0 &&
echo 111 >> a &&
- git add a &&
+ stg add a &&
git commit -m p1 &&
stg uncommit -n 1
'
@@ -29,7 +29,7 @@ EOF
test_expect_success 'Make a git commit and turn it into a patch' '
git rev-parse HEAD > head0.txt &&
echo 222 >> a &&
- git add a &&
+ stg add a &&
git commit -m p2 &&
git rev-parse HEAD > head1.txt &&
stg repair &&
diff --git a/t/t3200-non-ascii-filenames.sh b/t/t3200-non-ascii-filenames.sh
index 1aa78ed..fe2ecc0 100755
--- a/t/t3200-non-ascii-filenames.sh
+++ b/t/t3200-non-ascii-filenames.sh
@@ -11,11 +11,11 @@ EOF
test_expect_success 'Setup' '
echo "Fjäderholmarna" > skärgårdsö.txt &&
- git add skärgårdsö.txt &&
+ stg add skärgårdsö.txt &&
git commit -m "Create island" &&
stg init &&
echo foo > unrelated.txt &&
- git add unrelated.txt &&
+ stg add unrelated.txt &&
stg new p0 -m "Unrelated file" &&
stg refresh &&
stg pop &&
diff --git a/t/t3300-edit.sh b/t/t3300-edit.sh
index ad3b23f..7003a27 100755
--- a/t/t3300-edit.sh
+++ b/t/t3300-edit.sh
@@ -5,7 +5,7 @@ test_description='Test "stg edit"'
test_expect_success 'Setup' '
printf "000\n111\n222\n333\n" >> foo &&
- git add foo &&
+ stg add foo &&
git commit -m "Initial commit" &&
sed -i "s/000/000xx/" foo &&
git commit -a -m "First change" &&
diff --git a/t/t3400-pick.sh b/t/t3400-pick.sh
index 6e92de3..22b348c 100755
--- a/t/t3400-pick.sh
+++ b/t/t3400-pick.sh
@@ -7,11 +7,11 @@ test_expect_success \
'Initialize the StGIT repository' \
'
stg init &&
- stg new A -m "a" && echo A > a && git add a && stg refresh &&
- stg new B -m "b" && echo B > b && git add b && stg refresh &&
+ stg new A -m "a" && echo A > a && stg add a && stg refresh &&
+ stg new B -m "b" && echo B > b && stg add b && stg refresh &&
stg branch --clone foo &&
- stg new C -m "c" && echo C > c && git add c && stg refresh &&
- stg new D-foo -m "d" && echo D > d && git add d && stg refresh &&
+ stg new C -m "c" && echo C > c && stg add c && stg refresh &&
+ stg new D-foo -m "d" && echo D > d && stg add d && stg refresh &&
stg branch master
'
diff --git a/t/t4100-publish.sh b/t/t4100-publish.sh
index 17e07bc..7d72a6c 100755
--- a/t/t4100-publish.sh
+++ b/t/t4100-publish.sh
@@ -26,15 +26,15 @@ test_expect_success \
'
stg new p1 -m p1 &&
echo foo1 > foo1.txt &&
- git add foo1.txt &&
+ stg add foo1.txt &&
stg refresh &&
stg new p2 -m p2 &&
echo foo2 > foo2.txt &&
- git add foo2.txt &&
+ stg add foo2.txt &&
stg refresh &&
stg new p3 -m p3 &&
echo foo3 > foo3.txt &&
- git add foo3.txt &&
+ stg add foo3.txt &&
stg refresh
'
@@ -64,11 +64,11 @@ test_expect_success \
'
stg new p4 -m p4 &&
echo foo4 > foo4.txt &&
- git add foo4.txt &&
+ stg add foo4.txt &&
stg refresh &&
stg new p5 -m p5 &&
echo foo5 > foo5.txt &&
- git add foo5.txt &&
+ stg add foo5.txt &&
stg refresh &&
stg new empty -m empty &&
old_public=$(stg id master.public) &&
@@ -83,7 +83,7 @@ test_expect_success \
'
stg pop -a &&
echo foo0 > foo0.txt &&
- git add foo0.txt &&
+ stg add foo0.txt &&
git commit -m "foo0.txt added" &&
stg push -a &&
old_public=$(stg id master.public) &&
^ permalink raw reply related
* Re: base85: Two tiny fixes
From: Andreas Gruenbacher @ 2010-01-08 13:02 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: git
In-Reply-To: <alpine.LFD.2.00.1001071253400.21025@xanadu.home>
On Thursday 07 January 2010 18:58:01 Nicolas Pitre wrote:
> ACK. Please post them to this list.
Okay, done.
> On Thu, 7 Jan 2010, Andreas Gruenbacher wrote:
> > There is another little oddity in the way the de85 table is set up: 0
> > indicates an invalid entry; to avoid this from clashing with a valid entry,
> > valid entries are incremented by one and decremented again while decoding.
> > This leads to slightly worse code than using a negative number to indicate
> > invalid values (and avoiding to increment/decrement).
>
> You can make a patch to modify that as well if you wish.
Nah, it's not worth the noise.
> And in that case don't forget to make de85 explicitly signed as a char is
> unsigned by default on some platforms.
I would have forgotten this; thanks for pointing it out!
Thanks,
Andreas
^ 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