* Re: Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?
From: Michael Haggerty @ 2012-12-21 19:43 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Martin von Zweigbergk, git
In-Reply-To: <7vr4mj1g8j.fsf@alter.siamese.dyndns.org>
On 12/21/2012 06:12 PM, Junio C Hamano wrote:
> "diff" is always about two endpoints, not the path that connects
> these two endpoints (aka "range"), and when you want to "diff"
> between two commits, you say "diff A B". "A..B" happens to be
> accepted as such only by accident (e.g. the old command line parser
> did not have a reliable way to tell "^A B" and "A..B" apart), not by
> design.
>
> side note: incidentally, now we have rev_cmdline_info support,
> we could start deprecating "diff A..B" syntax.
I often find myself using "git diff A..B" syntax when using the command
line history because the previous command used "A..B"; e.g.,
git log A..B
git diff A..B
It's quick to recall the previous command, edit "log" -> "diff", and
press enter; having to remove the dots would require a few extra keypresses.
> Actually, in many places where the command line parser knows it
> wants a single point, and never a range, we should be able to apply
> the "A...B as a notation to specify a single point" rule.
>
> Of course you could come up with a symbol other than "..." for that
> purpose, and migrate the current "git checkout A...B" special case
> to use that other symbol, but that would be more work and also you
> would need to retrain existing users.
OTOH making A...B sometimes mean a range and sometimes a merge-base
(depending on context) adds a confusing non-uniformity, and also has the
disadvantage of making merge-base shorthand unavailable in contexts that
allow a range.
OTOOH git already has so many notations that can be used on the command
line; inventing yet another one would make it that much more overwhelming.
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* [PATCH 2/2] learn to pick/revert into unborn branch
From: Martin von Zweigbergk @ 2012-12-21 19:10 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Ramkumar Ramachandra, Martin von Zweigbergk
In-Reply-To: <1356117013-20613-1-git-send-email-martinvonz@gmail.com>
>From the user's point of view, it seems natural to think that
cherry-picking into an unborn branch should work, so make it work,
with or without --ff.
Cherry-picking anything other than a commit that only adds files, will
naturally result in conflicts. Similarly, revert also works, but will
result in conflicts unless the specified revision only deletes files.
Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
---
The plan is to use this for fixing "git rebase --root" as discussed in
http://thread.gmane.org/gmane.comp.version-control.git/205796
Is there a better way of creating an unborn branch than what I do in
the test cases?
sequencer.c | 19 +++++++++++--------
t/t3501-revert-cherry-pick.sh | 9 +++++++++
t/t3506-cherry-pick-ff.sh | 8 ++++++++
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 2260490..1ac1ceb 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -186,14 +186,15 @@ static int error_dirty_index(struct replay_opts *opts)
return -1;
}
-static int fast_forward_to(const unsigned char *to, const unsigned char *from)
+static int fast_forward_to(const unsigned char *to, const unsigned char *from,
+ int unborn)
{
struct ref_lock *ref_lock;
read_cache();
if (checkout_fast_forward(from, to, 1))
exit(1); /* the callee should have complained already */
- ref_lock = lock_any_ref_for_update("HEAD", from, 0);
+ ref_lock = lock_any_ref_for_update("HEAD", unborn ? null_sha1 : from, 0);
return write_ref_sha1(ref_lock, to, "cherry-pick");
}
@@ -390,7 +391,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
struct commit_message msg = { NULL, NULL, NULL, NULL, NULL };
char *defmsg = NULL;
struct strbuf msgbuf = STRBUF_INIT;
- int res;
+ int res, unborn = 0;
if (opts->no_commit) {
/*
@@ -402,9 +403,10 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
if (write_cache_as_tree(head, 0, NULL))
die (_("Your index file is unmerged."));
} else {
- if (get_sha1("HEAD", head))
- return error(_("You do not have a valid HEAD"));
- if (index_differs_from("HEAD", 0))
+ unborn = get_sha1("HEAD", head);
+ if (unborn)
+ hashcpy(head, EMPTY_TREE_SHA1_BIN);
+ if (index_differs_from(unborn ? EMPTY_TREE_SHA1_HEX : "HEAD", 0))
return error_dirty_index(opts);
}
discard_cache();
@@ -435,8 +437,9 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
else
parent = commit->parents->item;
- if (opts->allow_ff && parent && !hashcmp(parent->object.sha1, head))
- return fast_forward_to(commit->object.sha1, head);
+ if (opts->allow_ff &&
+ (parent && !hashcmp(parent->object.sha1, head) || !parent && unborn))
+ return fast_forward_to(commit->object.sha1, head, unborn);
if (parent && parse_commit(parent) < 0)
/* TRANSLATORS: The first %s will be "revert" or
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 34c86e5..6f489e2 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -100,4 +100,13 @@ test_expect_success 'revert forbidden on dirty working tree' '
'
+test_expect_success 'chery-pick on unborn branch' '
+ git checkout --orphan unborn &&
+ git rm --cached -r . &&
+ rm -rf * &&
+ git cherry-pick initial &&
+ git diff --quiet initial &&
+ ! test_cmp_rev initial HEAD
+'
+
test_done
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index 51ca391..373aad6 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -105,4 +105,12 @@ test_expect_success 'cherry pick a root commit with --ff' '
test "$(git rev-parse --verify HEAD)" = "1df192cd8bc58a2b275d842cede4d221ad9000d1"
'
+test_expect_success 'chery-pick --ff on unborn branch' '
+ git checkout --orphan unborn &&
+ git rm --cached -r . &&
+ rm -rf * &&
+ git cherry-pick --ff first &&
+ test_cmp_rev first HEAD
+'
+
test_done
--
1.8.0.1.240.ge8a1f5a
^ permalink raw reply related
* Re: Change in cvsps maintainership, abd a --fast-export option
From: Michael Haggerty @ 2012-12-21 19:19 UTC (permalink / raw)
To: esr; +Cc: git
In-Reply-To: <20121221104437.GA5244@thyrsus.com>
On 12/21/2012 11:44 AM, Eric S. Raymond wrote:
> Michael Haggerty <mhagger@alum.mit.edu>:
>> If you haven't yet seen it, there is a writeup of the algorithm used by
>> cvs2git to infer the history of a CVS repository [1]. If your goal is
>> to make cvsps more robust, you might want to consider the ideas
>> described there.
>
> I shall do so. Their design ideas may well be interesting, even though I
> don't trust their code. I've seem cvs2svn drop far too many weird artifacts
> and just plain broken commits in the back history of Subversion repositories.
> I don't know if this is due to design problems, implementation bugs, or both.
If you have seen any problems with cvs2svn/cvs2git, please file bug
reports. In the past years there have been very few valid bugs
reported. We very often find that artifacts that users thought were
bugs are in fact intentional workarounds required to make the contents
of branches and tags in the target VCS agree with those in the CVS
repository.
Perhaps your experience is with an older version of cvs2svn? If not,
please be specific rather than just making complaints that are too vague
to be rebutted or fixed (whichever is appropriate). I put a *lot* of
effort into getting cvs2svn to run correctly, and I take bug reports
very seriously.
Michael
(the cvs2svn maintainer)
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* [PATCH 1/2] tests: move test_cmp_rev to test-lib-functions
From: Martin von Zweigbergk @ 2012-12-21 19:10 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Ramkumar Ramachandra, Martin von Zweigbergk
A function for checking that two given parameters refer to the same
revision was defined in several places, so move the definition to
test-lib-functions.sh instead.
Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
---
t/t1505-rev-parse-last.sh | 18 +++++-------------
t/t3404-rebase-interactive.sh | 6 ------
t/t3507-cherry-pick-conflict.sh | 6 ------
t/t3508-cherry-pick-many-commits.sh | 8 ++------
t/t3510-cherry-pick-sequence.sh | 6 ------
t/t6030-bisect-porcelain.sh | 4 +---
t/test-lib-functions.sh | 7 +++++++
7 files changed, 15 insertions(+), 40 deletions(-)
diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh
index d709ecf..4969edb 100755
--- a/t/t1505-rev-parse-last.sh
+++ b/t/t1505-rev-parse-last.sh
@@ -32,32 +32,24 @@ test_expect_success 'setup' '
#
# and 'side' should be the last branch
-test_rev_equivalent () {
-
- git rev-parse "$1" > expect &&
- git rev-parse "$2" > output &&
- test_cmp expect output
-
-}
-
test_expect_success '@{-1} works' '
- test_rev_equivalent side @{-1}
+ test_cmp_rev side @{-1}
'
test_expect_success '@{-1}~2 works' '
- test_rev_equivalent side~2 @{-1}~2
+ test_cmp_rev side~2 @{-1}~2
'
test_expect_success '@{-1}^2 works' '
- test_rev_equivalent side^2 @{-1}^2
+ test_cmp_rev side^2 @{-1}^2
'
test_expect_success '@{-1}@{1} works' '
- test_rev_equivalent side@{1} @{-1}@{1}
+ test_cmp_rev side@{1} @{-1}@{1}
'
test_expect_success '@{-2} works' '
- test_rev_equivalent master @{-2}
+ test_cmp_rev master @{-2}
'
test_expect_success '@{-3} fails' '
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 32fdc99..8462be1 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -29,12 +29,6 @@ Initial setup:
. "$TEST_DIRECTORY"/lib-rebase.sh
-test_cmp_rev () {
- git rev-parse --verify "$1" >expect.rev &&
- git rev-parse --verify "$2" >actual.rev &&
- test_cmp expect.rev actual.rev
-}
-
set_fake_editor
# WARNING: Modifications to the initial repository can change the SHA ID used
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index c82f721..223b984 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -11,12 +11,6 @@ test_description='test cherry-pick and revert with conflicts
. ./test-lib.sh
-test_cmp_rev () {
- git rev-parse --verify "$1" >expect.rev &&
- git rev-parse --verify "$2" >actual.rev &&
- test_cmp expect.rev actual.rev
-}
-
pristine_detach () {
git checkout -f "$1^0" &&
git read-tree -u --reset HEAD &&
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 340afc7..4e7136b 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -5,15 +5,11 @@ test_description='test cherry-picking many commits'
. ./test-lib.sh
check_head_differs_from() {
- head=$(git rev-parse --verify HEAD) &&
- arg=$(git rev-parse --verify "$1") &&
- test "$head" != "$arg"
+ ! test_cmp_rev HEAD "$1"
}
check_head_equals() {
- head=$(git rev-parse --verify HEAD) &&
- arg=$(git rev-parse --verify "$1") &&
- test "$head" = "$arg"
+ test_cmp_rev HEAD "$1"
}
test_expect_success setup '
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index b5fb527..7b7a89d 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -24,12 +24,6 @@ pristine_detach () {
git clean -d -f -f -q -x
}
-test_cmp_rev () {
- git rev-parse --verify "$1" >expect.rev &&
- git rev-parse --verify "$2" >actual.rev &&
- test_cmp expect.rev actual.rev
-}
-
test_expect_success setup '
git config advice.detachedhead false &&
echo unrelated >unrelated &&
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 72e28ee..3e0e15f 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -676,9 +676,7 @@ test_expect_success 'bisect fails if tree is broken on trial commit' '
check_same()
{
echo "Checking $1 is the same as $2" &&
- git rev-parse "$1" > expected.same &&
- git rev-parse "$2" > expected.actual &&
- test_cmp expected.same expected.actual
+ test_cmp_rev "$1" "$2"
}
test_expect_success 'bisect: --no-checkout - start commit bad' '
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 22a4f8f..fa62d01 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -602,6 +602,13 @@ test_cmp() {
$GIT_TEST_CMP "$@"
}
+# Tests that its two parameters refer to the same revision
+test_cmp_rev () {
+ git rev-parse --verify "$1" >expect.rev &&
+ git rev-parse --verify "$2" >actual.rev &&
+ test_cmp expect.rev actual.rev
+}
+
# Print a sequence of numbers or letters in increasing order. This is
# similar to GNU seq(1), but the latter might not be available
# everywhere (and does not do letters). It may be used like:
--
1.8.0.1.240.ge8a1f5a
^ permalink raw reply related
* Re: [PATCH v4] git-completion.bash: add support for path completion
From: Manlio Perillo @ 2012-12-21 19:02 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, szeder, felipe.contreras
In-Reply-To: <7vmwx71e2y.fsf@alter.siamese.dyndns.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 21/12/2012 18:59, Junio C Hamano ha scritto:
> Manlio Perillo <manlio.perillo@gmail.com> writes:
>
>> + case "$path" in
>> + ?*/*) echo "${path%%/*}/" ;;
>> + *) echo $path ;;
>
> $path unquoted???
>
Missed again, thanks.
I hope this is really the last one!
> [...]
>> +__git_index_files ()
>> +{
>> + local dir="$(__gitdir)"
>> +
>> + if [ -d "$dir" ]; then
>> + # NOTE: $1 is not quoted in order to support multiple options
>
> Good thinking to document this. Thanks.
>
> I take it that $1 never comes from the end user and it is known that
> it is correct to split them at $IFS? That is the way I read callers
> of this function in this patch, but I am just double-checking.
>
Yes, $1 is always set internally (but I will check again)
Probably there are better solutions.
>> @@ -998,7 +1093,13 @@ _git_commit ()
>> "
>> return
>> esac
>> - COMPREPLY=()
>> +
>> + if git rev-parse --verify --quiet HEAD 1>/dev/null; then
>
> s/1>/>/;
>
What is the reason?
Coding style?
>> + __git_complete_diff_index_file "HEAD"
>
> As this runs "git diff-index" without --cached,
>
> The completion will give only for paths that have difference between
> the working tree and the HEAD. If the user has a bogus contents
> that was "git add"ed earlier, (i.e. the index is different from
> HEAD), then realizes the mistake and fixes it in the working tree
> with his editor to match "HEAD" (i.e. the working tree is the same
> as HEAD):
>
> git commit the-prefix-to-that-file<TAB>
>
> to complete the filename will not give that file. I do not think it
> is a show-stopper, but it may puzzle the users when they encounter
> the situation.
>
Umh, I just checked this case.
0) git init test
1) Added a README file with "Hello World.", and committed.
2) Modified the README file with "Hello World!" and executed
git add README
3) Modified the README file with "Hello World." (the original content)
4) $ git diff HEAD:README README
$ git diff-index --name-only HEAD
README
git commit <TAB> shows the README file.
If I understand correctly the documentation of diff-index, it will
always compare the content of the index with HEAD.
If --cached is specified, it will ignore the stat state of the file on disk.
> I am wondering if reading from "git status --porcelain" might be a
> better alternative, or if it is too much trouble and slow things
> down to cover such a corner case.
>
It have considered it.
The problem is that the output of "git status --porcelain" is not
trivial to parse.
>> @@ -1362,7 +1464,14 @@ _git_mv ()
>> return
>> ;;
>> esac
>> - COMPREPLY=()
>> +
>> + if [ $cword -gt 2 ]; then
>> + # We need to show both cached and untracked files (including
>> + # empty directories) since this may not be the last argument.
>> + __git_complete_index_file "--cached --others --directory"
>> + else
>> + __git_complete_index_file "--cached"
>> + fi
>
> Is $cword affected by the presense of "-f" in "git mv [-f] foo bar"?
> Just being curious.
>
Yes, it is affected; I missed it, thanks.
It should count only non-option arguments.
> Other than that, I do not see anything majorly wrong from the coding
> and semantics point of view in the patch. As to the interaction
> with the rest of the completion machinery, I'll leave the review to
> the area experts CC'ed and wait for their comments.
>
> Thanks.
>
Thanks for your review.
Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlDUsjwACgkQscQJ24LbaUSGuwCffon7/VGFo98CCBsZlmOdNYYE
91oAn3X8fbr5jtzMUOZkMp9CuGWCa7Cf
=Qzsv
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: Python version auditing followup
From: Junio C Hamano @ 2012-12-21 18:48 UTC (permalink / raw)
To: Joachim Schmitz; +Cc: git
In-Reply-To: <006101cddfab$2afb0cf0$80f126d0$@schmitz-digital.de>
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:
>> From: Junio C Hamano [mailto:gitster@pobox.com]
>> Sent: Friday, December 21, 2012 7:28 PM
>> To: Joachim Schmitz
>> Cc: git@vger.kernel.org
>> Subject: Re: Python version auditing followup
>>
>> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
>>
>> >> > We have a working 2.4.2 for HP-NonStop and some major problems getting
>> >> > 2.7.3 to work.
>> >>
>> >> I do not think a platform that stops at 2.4.2 instead of going to
>> >> higher 2.4.X series deserves to be called "long term maintained by
>> >> their vendors". It sounds more like "attempted to supply 2.4.X and
>> >> abandoned the users once one port was done" to me.
>> >
>> > Well, not entirely wrong, but not all true at too.
>> > I guess I need to defend the vendor here: It is not really the
>> > Vendor (HP) that provided Python 2.4.2 or tries to provide 2.7.3,
>> > it is a volunteer and community effort. HP did sponsor the 2.4.2
>> > port though (by allowing an HP employee to do the port inn his
>> > regular working hours). It is not doing this any longer (since
>> > 2007). Since then it is a small group doing this on a purely
>> > voluntary basis in their spare time (one HP employee amongst them,
>> > me). Same goes for the git port BTW.
>>
>> For the purpose of "if we draw the line at 2.6, would it hurt many
>> people who have been happily using the existing release of Git that
>> was happy with 2.4", it is dubious HP-NonStop counts. It is not
>> like the users on that platform have been happily using Python based
>> Porcelain at the fringe of Git, and drawing the line at 2.6 will not
>> give them any regression.
>
> You asked for opions and obhections, you got mine ;-)
Yeah, duly noted, and appreciated.
^ permalink raw reply
* RE: Python version auditing followup
From: Joachim Schmitz @ 2012-12-21 18:44 UTC (permalink / raw)
To: 'Junio C Hamano'; +Cc: git
In-Reply-To: <7va9t71cqa.fsf@alter.siamese.dyndns.org>
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: Friday, December 21, 2012 7:28 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: Python version auditing followup
>
> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
>
> >> > We have a working 2.4.2 for HP-NonStop and some major problems getting
> >> > 2.7.3 to work.
> >>
> >> I do not think a platform that stops at 2.4.2 instead of going to
> >> higher 2.4.X series deserves to be called "long term maintained by
> >> their vendors". It sounds more like "attempted to supply 2.4.X and
> >> abandoned the users once one port was done" to me.
> >
> > Well, not entirely wrong, but not all true at too.
> > I guess I need to defend the vendor here: It is not really the
> > Vendor (HP) that provided Python 2.4.2 or tries to provide 2.7.3,
> > it is a volunteer and community effort. HP did sponsor the 2.4.2
> > port though (by allowing an HP employee to do the port inn his
> > regular working hours). It is not doing this any longer (since
> > 2007). Since then it is a small group doing this on a purely
> > voluntary basis in their spare time (one HP employee amongst them,
> > me). Same goes for the git port BTW.
>
> For the purpose of "if we draw the line at 2.6, would it hurt many
> people who have been happily using the existing release of Git that
> was happy with 2.4", it is dubious HP-NonStop counts. It is not
> like the users on that platform have been happily using Python based
> Porcelain at the fringe of Git, and drawing the line at 2.6 will not
> give them any regression.
You asked for opions and obhections, you got mine ;-)
^ permalink raw reply
* Re: [PATCH 0/3] Move api-command.txt from ./technical/ to ./howto
From: Junio C Hamano @ 2012-12-21 18:33 UTC (permalink / raw)
To: Thomas Ackermann; +Cc: git
In-Reply-To: <1595193006.286662.1356112971883.JavaMail.ngmail@webmail14.arcor-online.net>
Thomas Ackermann <th.acker@arcor.de> writes:
> "api-command.txt" describes a different kind of API than the other api-* documents.
> So better move it to the howto documents in ./Documentation/howto and rename
> to "new-command.txt".
>
> [PATCH 1/3] Move ./technical/api-command.txt to ./howto/new-command.txt
> [PATCH 2/3] Add new-command.txt to ./Documentation/Makefile
> [PATCH 3/3] Amend new-command.txt to be processed correctly by howto-index.sh
>
> Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Seems good from a cursory look, but I think this is better done in a
single patch. If you do not mind, I'll squash them into one.
Thanks.
^ permalink raw reply
* Re: Python version auditing followup
From: Junio C Hamano @ 2012-12-21 18:28 UTC (permalink / raw)
To: Joachim Schmitz; +Cc: git
In-Reply-To: <000d01cddf4c$8cbf2ca0$a63d85e0$@schmitz-digital.de>
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:
>> > We have a working 2.4.2 for HP-NonStop and some major problems getting
>> > 2.7.3 to work.
>>
>> I do not think a platform that stops at 2.4.2 instead of going to
>> higher 2.4.X series deserves to be called "long term maintained by
>> their vendors". It sounds more like "attempted to supply 2.4.X and
>> abandoned the users once one port was done" to me.
>
> Well, not entirely wrong, but not all true at too.
> I guess I need to defend the vendor here: It is not really the
> Vendor (HP) that provided Python 2.4.2 or tries to provide 2.7.3,
> it is a volunteer and community effort. HP did sponsor the 2.4.2
> port though (by allowing an HP employee to do the port inn his
> regular working hours). It is not doing this any longer (since
> 2007). Since then it is a small group doing this on a purely
> voluntary basis in their spare time (one HP employee amongst them,
> me). Same goes for the git port BTW.
For the purpose of "if we draw the line at 2.6, would it hurt many
people who have been happily using the existing release of Git that
was happy with 2.4", it is dubious HP-NonStop counts. It is not
like the users on that platform have been happily using Python based
Porcelain at the fringe of Git, and drawing the line at 2.6 will not
give them any regression.
It does add more things that needs to be done to the volunteer
developers for that platform and the organization that may want to
support the platform (as they have to finish 2.6 port if we decide
to draw the line there), but that is a secondary consideration.
^ permalink raw reply
* Re: [PATCH] http.c: Avoid username prompt for certifcate credentials
From: Junio C Hamano @ 2012-12-21 18:19 UTC (permalink / raw)
To: Jeff King; +Cc: Rene Bredlau, git
In-Reply-To: <20121221170927.GA23574@sigill.intra.peff.net>
Thanks, both.
^ permalink raw reply
* Re: recommendation for patch maintenance
From: Junio C Hamano @ 2012-12-21 18:17 UTC (permalink / raw)
To: Manlio Perillo; +Cc: git
In-Reply-To: <50D49C81.5060007@gmail.com>
Manlio Perillo <manlio.perillo@gmail.com> writes:
> I lose the history of all the changes I have made to produce the final
> version of a patch.
>
> Since for every new version of a patch I do a commit --amend, I can not
> see, as an example, the changes I have made between x and y versions of
> a patch.
>
> Of course the commits are not really lost, but I have to search them
> using the reflog.
Yeah, these days with "rebase -i" that does not leave individual
steps as separate reflog entries, for an easy series, you can do
things like:
$ git rebase -i ;# work on polishing the series
$ git show-branch -g ;# view where it diverged
$ git diff HEAD~4 @{1}~4
Of course you can plan ahead (this is what I usually do when working
on a series that is not "how about this" throw-away patch I send to
this list all the time) and name the topic "topic-v1", fork the new
round "topic-v2", "topic-v3", etc. and do things like
$ sh -c 'git diff topic-v2~$1 topic-v3~$1' - 4
(the point being that then you do ^P or whatever shell command
history mechanism to recall that line, edit "4" to "3" and rerun the
comparison for other corresponding ones).
On a related but different front, I've been thinking about improving
the "format-patch --subject-prefix" mechanism to make it even easier
to use. With the current interface, when you prepare your reroll,
you would do:
$ git format-patch --cover-letter \
--subject-prefix='PATCH v4' -o ./+mp master
and end up overwriting the patches from the previous round (if their
subject did not change). You will always overwrite the cover
because its subject never changes and that is where the filename is
taken from.
What if we added another option, say --reroll $n (or -v$n), to let
you write:
$ git format-patch --cover-letter -v4 -o ./+mp master
that produces output files named like:
./+mp/v4-0000-cover-letter.txt
./+mp/v4-0001-git-completion.bash.add-support-for-pa.txt
with the subject '[PATCH v4]' prefix?
Then you can transplant the cover letter material from the cover
letter from the older iteration to the new cover letter in your
editor, and sending them out will become
$ git send-email ... ./+mp/v4-*.txt
Hmm?
^ permalink raw reply
* [PATCH 3/3] Amend new-command.txt to be processed correctly by howto-index.sh
From: Thomas Ackermann @ 2012-12-21 18:07 UTC (permalink / raw)
To: git; +Cc: th.acker
In-Reply-To: <1595193006.286662.1356112971883.JavaMail.ngmail@webmail14.arcor-online.net>
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
---
Documentation/howto/new-command.txt | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/howto/new-command.txt b/Documentation/howto/new-command.txt
index d3b9781..36502f6 100644
--- a/Documentation/howto/new-command.txt
+++ b/Documentation/howto/new-command.txt
@@ -1,5 +1,10 @@
-Integrating new subcommands
-===========================
+From: Eric S. Raymond <esr@thyrsus.com>
+Abstract: This is how-to documentation for people who want to add extension
+ commands to git. It should be read alongside api-builtin.txt.
+Content-type: text/asciidoc
+
+How to integrate new subcommands
+================================
This is how-to documentation for people who want to add extension
commands to git. It should be read alongside api-builtin.txt.
--
1.8.0.msysgit.0
---
Thomas
^ permalink raw reply related
* [PATCH 2/3] Add new-command.txt to ./Documentation/Makefile
From: Thomas Ackermann @ 2012-12-21 18:06 UTC (permalink / raw)
To: git; +Cc: th.acker
In-Reply-To: <1595193006.286662.1356112971883.JavaMail.ngmail@webmail14.arcor-online.net>
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
---
Documentation/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 7df75d0..f3afcb6 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -21,6 +21,7 @@ ARTICLES += git-tools
ARTICLES += git-bisect-lk2009
# with their own formatting rules.
SP_ARTICLES = user-manual
+SP_ARTICLES += howto/new-command
SP_ARTICLES += howto/revert-branch-rebase
SP_ARTICLES += howto/using-merge-subtree
SP_ARTICLES += howto/using-signed-tag-in-pull-request
--
1.8.0.msysgit.0
---
Thomas
^ permalink raw reply related
* [PATCH 1/3] Move ./technical/api-command.txt to ./howto/new-command.txt
From: Thomas Ackermann @ 2012-12-21 18:05 UTC (permalink / raw)
To: git; +Cc: th.acker
In-Reply-To: <1595193006.286662.1356112971883.JavaMail.ngmail@webmail14.arcor-online.net>
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
---
Documentation/{technical/api-command.txt => howto/new-command.txt} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename Documentation/{technical/api-command.txt => howto/new-command.txt} (100%)
diff --git a/Documentation/technical/api-command.txt b/Documentation/howto/new-command.txt
similarity index 100%
rename from Documentation/technical/api-command.txt
rename to Documentation/howto/new-command.txt
--
1.8.0.msysgit.0
---
Thomas
^ permalink raw reply
* [PATCH 0/3] Move api-command.txt from ./technical/ to ./howto
From: Thomas Ackermann @ 2012-12-21 18:02 UTC (permalink / raw)
To: git; +Cc: th.acker
"api-command.txt" describes a different kind of API than the other api-* documents.
So better move it to the howto documents in ./Documentation/howto and rename
to "new-command.txt".
[PATCH 1/3] Move ./technical/api-command.txt to ./howto/new-command.txt
[PATCH 2/3] Add new-command.txt to ./Documentation/Makefile
[PATCH 3/3] Amend new-command.txt to be processed correctly by howto-index.sh
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
---
Thomas
^ permalink raw reply
* Re: [PATCH v4] git-completion.bash: add support for path completion
From: Junio C Hamano @ 2012-12-21 17:59 UTC (permalink / raw)
To: Manlio Perillo; +Cc: git, szeder, felipe.contreras
In-Reply-To: <1356108872-5881-1-git-send-email-manlio.perillo@gmail.com>
Manlio Perillo <manlio.perillo@gmail.com> writes:
> + case "$path" in
> + ?*/*) echo "${path%%/*}/" ;;
> + *) echo $path ;;
$path unquoted???
> +# __git_index_files accepts 1 or 2 arguments:
> +# 1: Options to pass to ls-files (required).
> +# Supported options are --cached, --modified, --deleted, --others,
> +# and --directory.
> +# 2: A directory path (optional).
> +# If provided, only files within the specified directory are listed.
> +# Sub directories are never recursed. Path must have a trailing
> +# slash.
> +__git_index_files ()
> +{
> + local dir="$(__gitdir)"
> +
> + if [ -d "$dir" ]; then
> + # NOTE: $1 is not quoted in order to support multiple options
Good thinking to document this. Thanks.
I take it that $1 never comes from the end user and it is known that
it is correct to split them at $IFS? That is the way I read callers
of this function in this patch, but I am just double-checking.
> @@ -998,7 +1093,13 @@ _git_commit ()
> "
> return
> esac
> - COMPREPLY=()
> +
> + if git rev-parse --verify --quiet HEAD 1>/dev/null; then
s/1>/>/;
> + __git_complete_diff_index_file "HEAD"
As this runs "git diff-index" without --cached,
The completion will give only for paths that have difference between
the working tree and the HEAD. If the user has a bogus contents
that was "git add"ed earlier, (i.e. the index is different from
HEAD), then realizes the mistake and fixes it in the working tree
with his editor to match "HEAD" (i.e. the working tree is the same
as HEAD):
git commit the-prefix-to-that-file<TAB>
to complete the filename will not give that file. I do not think it
is a show-stopper, but it may puzzle the users when they encounter
the situation.
I am wondering if reading from "git status --porcelain" might be a
better alternative, or if it is too much trouble and slow things
down to cover such a corner case.
> @@ -1362,7 +1464,14 @@ _git_mv ()
> return
> ;;
> esac
> - COMPREPLY=()
> +
> + if [ $cword -gt 2 ]; then
> + # We need to show both cached and untracked files (including
> + # empty directories) since this may not be the last argument.
> + __git_complete_index_file "--cached --others --directory"
> + else
> + __git_complete_index_file "--cached"
> + fi
Is $cword affected by the presense of "-f" in "git mv [-f] foo bar"?
Just being curious.
Other than that, I do not see anything majorly wrong from the coding
and semantics point of view in the patch. As to the interaction
with the rest of the completion machinery, I'll leave the review to
the area experts CC'ed and wait for their comments.
Thanks.
^ permalink raw reply
* [PATCH] http.c: Avoid username prompt for certifcate credentials
From: Rene Bredlau @ 2012-12-21 16:31 UTC (permalink / raw)
To: git; +Cc: peff, gitster, Rene Bredlau
If sslCertPasswordProtected is set to true do not ask for username to decrypt rsa key. This question is pointless, the key is only protected by a password. Internaly the username is simply set to "".
Signed-off-by: Rene Bredlau <git@unrelated.de>
---
http.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/http.c b/http.c
index 0a8abf3..44f3525 100644
--- a/http.c
+++ b/http.c
@@ -236,6 +236,7 @@ static int has_cert_password(void)
return 0;
if (!cert_auth.password) {
cert_auth.protocol = xstrdup("cert");
+ cert_auth.username = xstrdup("");
cert_auth.path = xstrdup(ssl_cert);
credential_fill(&cert_auth);
}
--
1.7.9
^ permalink raw reply related
* Re: recommendation for patch maintenance
From: Manlio Perillo @ 2012-12-21 17:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vvcbv1grr.fsf@alter.siamese.dyndns.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 21/12/2012 18:01, Junio C Hamano ha scritto:
> Manlio Perillo <manlio.perillo@gmail.com> writes:
>
>> I would like to have advices about some possible workflows to use when
>> maintaining a patch, that can evolve over the time (fixing bugs, and
>> applying advices from reviewers).
>>
> [...]
>> when I need to update the patch:
>>
>> 1) modify code
>> 2) commit --amend
>> 3) format-patch --subject-prefix="PATCH v<n>" \
>> --output=mp/complete-patch master
>> 4) edit patch to add a list of what was changed
>> 5) review the patch
>> 6) send-email
>>
>> This is far from ideal, since all my local changes are lost.
>
> Not offering any answer, but it is unclear to me what local changes
> you are losing here. Care to explain?
I lose the history of all the changes I have made to produce the final
version of a patch.
Since for every new version of a patch I do a commit --amend, I can not
see, as an example, the changes I have made between x and y versions of
a patch.
Of course the commits are not really lost, but I have to search them
using the reflog.
Thanks Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlDUnIAACgkQscQJ24LbaUTf0QCfX9WtA+/GLzVWDJFPbLMCPucJ
bKQAnj0HJuQs9SVCPV/TlDXcpGDqIqfD
=lhZ5
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?
From: Junio C Hamano @ 2012-12-21 17:12 UTC (permalink / raw)
To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <CANiSa6ibS7ORY=QMS3WQzXYJQQH4ZYvPO75qgLgv-oWGMSBBrw@mail.gmail.com>
Martin von Zweigbergk <martinvonz@gmail.com> writes:
> I keep forgetting what "git diff A..B" does.
"diff" is always about two endpoints, not the path that connects
these two endpoints (aka "range"), and when you want to "diff"
between two commits, you say "diff A B". "A..B" happens to be
accepted as such only by accident (e.g. the old command line parser
did not have a reliable way to tell "^A B" and "A..B" apart), not by
design.
side note: incidentally, now we have rev_cmdline_info support,
we could start deprecating "diff A..B" syntax.
The special case "git checkout master...branch" is not about
specifying a range. The command knows it wants a single point (not
two endpoints, nor a range), and A...B as a notation to specify a
single point is $(merge-base A B).
> I would have much preferred if
> it was possible to make the revision parser generally interpret e.g.
> "A.^.B" as "the merge base of A and B" (failing if not exactly one).
Actually, in many places where the command line parser knows it
wants a single point, and never a range, we should be able to apply
the "A...B as a notation to specify a single point" rule.
Of course you could come up with a symbol other than "..." for that
purpose, and migrate the current "git checkout A...B" special case
to use that other symbol, but that would be more work and also you
would need to retrain existing users.
^ permalink raw reply
* Re: [PATCH] Documentation/git-clean: Document --force --force
From: Soren Brinkmann @ 2012-12-21 17:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Soren Brinkmann, git
In-Reply-To: <7vr4mk2jmy.fsf@alter.siamese.dyndns.org>
On Thu, Dec 20, 2012 at 07:01:41PM -0800, Junio C Hamano wrote:
> Soren Brinkmann <soren.brinkmann@xilinx.com> writes:
>
> > Ping?
>
> I *think* it is a mistake for the command to remove a separate
> project repository within, with any number of "-f", so I'd rather
> see a patch to fix it, instead of casting such a misbehaviour as a
> feature in stone by documenting it.
>
> I dunno.
Since I use this feature, I naturally have to disagree. But fair point. And with
the patch rectifying git-clean output it's probably tolerable.
Though, what would be your way of cleaning files/dirs from a repository where
git-clean will report to have some left undeleted? Manually calling rm -rf?
Soren
^ permalink raw reply
* Re: [PATCH] http.c: Avoid username prompt for certifcate credentials
From: Jeff King @ 2012-12-21 17:09 UTC (permalink / raw)
To: Rene Bredlau; +Cc: git, gitster
In-Reply-To: <1356107479-6668-1-git-send-email-git@unrelated.de>
On Fri, Dec 21, 2012 at 05:31:19PM +0100, Rene Bredlau wrote:
> If sslCertPasswordProtected is set to true do not ask for username to
> decrypt rsa key. This question is pointless, the key is only protected
> by a password. Internaly the username is simply set to "".
Yeah, that makes sense. I suspect the cert-unlocking code paths for
credential helpers are not that well used (and I do not think we have
any test coverage for them at all), so I am not too surprised that this
went unreported for a long time.
Thanks.
> Signed-off-by: Rene Bredlau <git@unrelated.de>
Acked-by: Jeff King <peff@peff.net>
-Peff
^ permalink raw reply
* Re: recommendation for patch maintenance
From: Junio C Hamano @ 2012-12-21 17:01 UTC (permalink / raw)
To: Manlio Perillo; +Cc: git
In-Reply-To: <50D475EF.6060303@gmail.com>
Manlio Perillo <manlio.perillo@gmail.com> writes:
> I would like to have advices about some possible workflows to use when
> maintaining a patch, that can evolve over the time (fixing bugs, and
> applying advices from reviewers).
>
> In my case I have a single commit to maintain.
>
>
> The workflow I use now is this:
>
> 1) create a topic branch, e.g. mp/complete-path
> 2) write code
> 3) commit
> 4) format-patch --output=mp/complete-patch master
> 5) review the patch
> 6) send-email
>
> when I need to update the patch:
>
> 1) modify code
> 2) commit --amend
> 3) format-patch --subject-prefix="PATCH v<n>" \
> --output=mp/complete-patch master
> 4) edit patch to add a list of what was changed
> 5) review the patch
> 6) send-email
>
> This is far from ideal, since all my local changes are lost.
Not offering any answer, but it is unclear to me what local changes
you are losing here. Care to explain?
^ permalink raw reply
* Re: [PATCH v7 2/7] tests: paint known breakages in yellow
From: Stefano Lattarini @ 2012-12-21 16:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Adam Spiers, Jeff King
In-Reply-To: <7vd2y32ys0.fsf@alter.siamese.dyndns.org>
On 12/21/2012 04:46 PM, Junio C Hamano wrote:
>
> [SNIP]
>
> The only thing the additional knowledge adds seems to be to give
> rationale for the old choice of "bold green"---it was not chosen
> from thin-air but can be viewed as following the automake/autotest
> scheme, and other systems cannot agree on what color to pick for
> this purpose.
>
> I do not see a need to justify why we chose differently from
> automake/autotest; we could say something like:
>
> Yellow seems a more appropriate color than bold green when
> considering the universal traffic lights coloring scheme, where
> green conveys the impression that everything's OK, and amber that
> something's not quite right. This is in line with what 'prove'
> uses, but different from 'automake/autotest' do.
>
> but we are not in the business of choosing which is more correct
> between prove and automake/autotest, and I do not see how it adds
> much value to tell readers that color choices are not universally
> agreed upon across various test software suites---that's kind of
> known, isn't it?
>
> So...
>
That is fine with me, I just pointed it out because I suspected not
everybody was aware of all these details. If you decide they don't
matter, it's perfectly OK -- but at least now it's an informed
choice ;-)
Thanks,
Stefano
^ permalink raw reply
* Re: [BUG] Cannot push some grafted branches
From: Junio C Hamano @ 2012-12-21 16:58 UTC (permalink / raw)
To: Michael J Gruber
Cc: Thomas Rast, Yann Dirson, Andreas Schwab, Christian Couder,
git list, Jeff King
In-Reply-To: <50D45A78.3020104@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> While replace refs are much more general than grafts, it seems the two
> main uses are:
>
> - grafts (change the recorded parents for a commit)
> - svn cleanup (convert tagging commits into tag objects)
>
> The latter one being quite a special case already.
>
> The script below has helped me move from grafts to replace objects.
> While not being super clean, something like it may be fit for contrib.
>
> I think we ought to help John Doe get along with parents, while we can
> safely leave most more advanced operations to people who know how to
> edit a raw object file. Putting that facility into "git-commit" seems to
> be too encouraging, though - people would use replace when they should
> use amend or rebase-i. I'd prefer a special git-replace mode (be it
> "--graft" or "--graft-commit") which does just what my script does. We
> could add things like "--commit-tag" later, a full blown
> "object-factory" seems like overkill.
>
> Michael
>
> --->%---
>
> #!/bin/sh
>
> die () {
> echo "$@"
> rm -f "$commitfile"
> exit 1
> }
>
> warn () {
> echo "$@"
> }
>
> test $# -gt 0 || die "Usage: $0 <commit> [<parent>]*"
>
> for commit
> do
> git rev-parse --verify -q "$commit" >/dev/null || die "Cannot parse
> $commit."
> test x$(git cat-file -t $commit) == "xcommit" || die "$commit is no
> commit."
s/==/=/ or you have to say #!/bin/bash on the first line, I think.
Appears multiple times throughout this script.
> done
>
> commit="$1"
> shift
>
> commitfile=$(mktemp)
>
> git cat-file commit "$commit" | while read a b
> do
> if test "$a" != "parent"
> then
> echo $a $b
You are losing information on non-header lines by reading without
"-r" in the above, and also multi-line headers (e.g. mergetag),
aren't you?
> fi
> if test "$a" == "tree"
> then
> for parent
> do
> echo "parent $(git rev-parse $parent)"
> done
> fi
> done >$commitfile
> hash=$(git hash-object -t commit -w "$commitfile") || die "Cannot create
> commit object."
> git replace "$commit" $hash
> rm -f $commitfile
^ permalink raw reply
* Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?
From: Martin von Zweigbergk @ 2012-12-21 16:55 UTC (permalink / raw)
To: git, Junio C Hamano
In-Reply-To: <CANiSa6jP_JN+DpDgYpWA9Aky9REJvFq3aR3Yj0vF3+axWvtmsw@mail.gmail.com>
Oops, meant for all of you.
---------- Forwarded message ----------
From: Martin von Zweigbergk <martinvonz@gmail.com>
Date: Fri, Dec 21, 2012 at 8:45 AM
Subject: Re: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?
To: Junio C Hamano <gitster@pobox.com>
On Fri, Dec 21, 2012 at 7:58 AM, Junio C Hamano <gitster@pobox.com> wrote:
> $ git checkout -B branch <old fork point>
>
> Unfortunately, master...branch syntax does not seem to work for
> specifying the "old fork point" for this purpose
I have personally always found it confusing to use the same syntax for
specifying ranges/sets and single revisions. I keep forgetting what
"git diff A..B" does. I know it doesn't do what I expect (i.e. "git
diff $(git merge-base A B) B"), but I don't know what it does (maybe
same as "git diff A B" (?), but that's besides the point). Having
worked a bit on rebase, I know that $onto can also take the "A...B"
form. So there is clearly some precedence for the "..." syntax to
refer to a revision in some contexts. I would have much preferred if
it was possible to make the revision parser generally interpret e.g.
"A.^.B" as "the merge base of A and B" (failing if not exactly one).
It seems like something that must have come up before. Is there a
particular reason this would not be a good idea?
^ 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