Git development
 help / color / mirror / Atom feed
* Re: [PATCH] update-index: add --swap to swap index and worktree content
From: Nguyen Thai Ngoc Duy @ 2011-08-17 14:32 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: Jeff King, Junio C Hamano, git
In-Reply-To: <CAOeW2eFx-ETS+1a5b2bUXeT8JJ0WGudKGyF6mxuqyK2OM35qQA@mail.gmail.com>

On Wed, Aug 17, 2011 at 9:13 PM, Martin von Zweigbergk
<martin.von.zweigbergk@gmail.com> wrote:
> Hi,
>
> On Tue, Aug 16, 2011 at 10:17 PM, Jeff King <peff@peff.net> wrote:
>> On Wed, Aug 17, 2011 at 09:11:32AM +0700, Nguyen Thai Ngoc Duy wrote:
>>
>>> Two reasons. I already mentioned the ability to quickly checkout index
>>> for a quick test (though there could be more problems down that road).
>>
>> That's a good thought. However, in practice, I find I also need other
>> files from the index to do a successful test. So I end up just
>> committing what I think is right, and then afterwards do:
>
> Maybe a stupid question, but "update-index --swap" would swap all
> files, right? So what "other files from the index" would there be?

That's some of the "problems down that road", another one being
removed files in index. Still the ability to do a quick compile on a
single file is cool.

> Maybe the above shows that I'm missing something. Still, would it be
> possible to achieve the use case with something like the following?
>
> git stash --keep-index
> # fix up files, test etc.
> git add ....
> git commit
> git cherry-pick --strategy=theirs stash && git stash drop

Pretty much (if I understand git-stash correctly, I haven't used it
much), except that if I change my mind mid way, I can switch back to
the original state and keep working:

1. git add -p ...
2. git update-index --swap foo # index <-> wt
3. # make some minor edit, "make foo.o", oops failed, I missed some hunks
4. git checkout -p ...
5. # still not happy, more changes should be made on both index and wt
6. git update-index --swap foo # now index is index, wt is wt
7. # edit some more, when ready to commit, repeat steps 2-6 again
8. git commit
-- 
Duy

^ permalink raw reply

* Re: shallow clone not very shallow due to tags
From: Shawn Pearce @ 2011-08-17 14:19 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git
In-Reply-To: <CACsJy8CXiZ8uGruAk5XGFhY8MJsTHAPv3Mvh0euQdFE3U43MCg@mail.gmail.com>

On Tue, Aug 16, 2011 at 19:49, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> On Tue, Aug 16, 2011 at 12:16 AM, Shawn Pearce > Yes, I think a user
> who is making a shallow clone should only get the
>> HEAD branch to the depth specified, nothing else. If they want
>> additional branches, they should either pass them on the command line
>> to a new flag for clone, or modify their fetch configuration
>> after-the-fact and fetch those separately.
>
> I'd like maintain all refs of the repo, even though we though we only
> have objects for one branch. If I do a shallow clone and want to
> change branch, I could just list available branch locally instead of
> going to gitweb.somewhere for the branch name.
>
> Do we have someway to represent a ref placeholder?

Not currently, no. I haven't checked refs.c, but you may be able to
create an empty (0 byte) ref file for each remote reference we didn't
obtain. These should be ignored since they aren't a valid reference..
Though they might cause warnings to be sent to stderr on every
command, since they exist in the refs directory but aren't a valid
reference.

Of course a placeholder ref cannot be used as a starting point to
checkout something, can it? It has no commit object available. So if
you did decide to checkout a placeholder, you would need to first
fetch that placeholder. So why not use git ls-remote to list the
remotely available branches?

-- 
Shawn.

^ permalink raw reply

* Re: [PATCH] update-index: add --swap to swap index and worktree content
From: Martin von Zweigbergk @ 2011-08-17 14:13 UTC (permalink / raw)
  To: Jeff King, Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, git
In-Reply-To: <20110817021727.GA29585@sigill.intra.peff.net>

Hi,

On Tue, Aug 16, 2011 at 10:17 PM, Jeff King <peff@peff.net> wrote:
> On Wed, Aug 17, 2011 at 09:11:32AM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> Two reasons. I already mentioned the ability to quickly checkout index
>> for a quick test (though there could be more problems down that road).
>
> That's a good thought. However, in practice, I find I also need other
> files from the index to do a successful test. So I end up just
> committing what I think is right, and then afterwards do:

Maybe a stupid question, but "update-index --swap" would swap all
files, right? So what "other files from the index" would there be?

Maybe the above shows that I'm missing something. Still, would it be
possible to achieve the use case with something like the following?

git stash --keep-index
# fix up files, test etc.
git add ....
git commit
git cherry-pick --strategy=theirs stash && git stash drop

Martin

^ permalink raw reply

* [PATCH] checkout-index: remove obsolete comment
From: Nguyễn Thái Ngọc Duy @ 2011-08-17 12:22 UTC (permalink / raw)
  To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy

The first paragraph about flag order is no longer true and is
mentioned in git-checkout-index.txt. The rest is also mentioned in
git-checkout-index.txt.

Remove it and keep uptodate document in one place.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/checkout-index.c |   32 --------------------------------
 1 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index f1fec24..c16d82b 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -3,38 +3,6 @@
  *
  * Copyright (C) 2005 Linus Torvalds
  *
- * Careful: order of argument flags does matter. For example,
- *
- *	git checkout-index -a -f file.c
- *
- * Will first check out all files listed in the cache (but not
- * overwrite any old ones), and then force-checkout "file.c" a
- * second time (ie that one _will_ overwrite any old contents
- * with the same filename).
- *
- * Also, just doing "git checkout-index" does nothing. You probably
- * meant "git checkout-index -a". And if you want to force it, you
- * want "git checkout-index -f -a".
- *
- * Intuitiveness is not the goal here. Repeatability is. The
- * reason for the "no arguments means no work" thing is that
- * from scripts you are supposed to be able to do things like
- *
- *	find . -name '*.h' -print0 | xargs -0 git checkout-index -f --
- *
- * or:
- *
- *	find . -name '*.h' -print0 | git checkout-index -f -z --stdin
- *
- * which will force all existing *.h files to be replaced with
- * their cached copies. If an empty command line implied "all",
- * then this would force-refresh everything in the cache, which
- * was not the point.
- *
- * Oh, and the "--" is just a good idea when you know the rest
- * will be filenames. Just so that you wouldn't have a filename
- * of "-a" causing problems (not possible in the above example,
- * but get used to it in scripting!).
  */
 #include "builtin.h"
 #include "cache.h"
-- 
1.7.4.74.g639db

^ permalink raw reply related

* Re: [BUG] git-svn: error importing git repository in svn when first git commit was empty
From: Michael J Gruber @ 2011-08-17 11:17 UTC (permalink / raw)
  To: s b; +Cc: git
In-Reply-To: <CAAzBVjAjqr8hDFdMc2s6d=ZXttswSnLiig-aFKsZG5EJjAyAig@mail.gmail.com>

s b venit, vidit, dixit 11.08.2011 11:13:
> Couldn't find any bugtracker for git so I supposed it would be ok to
> post the bug here.
> 
> # Situation:
> I usually start my projects with git as it's quick and simple to track
> modifications. If the code grows and is of any interest for my work I
> push it to the corporate svn. I usually use this tutorial
> (http://eikke.com/importing-a-git-tree-into-a-subversion-repository/)
> which makes it a simple thing to do.
> Some time ago I started having a first empty commit in my git
> repository using 'git commit --allow-empty' as I read (can't remember
> where) it could help for some cases. I don't have need for those edge
> cases yet but remember thinking I could need them in the future.
> 
> # Problem:
> When your first git commit is empty, git-svn fails with the following message :
> $ git svn dcommit
> Committing to https://svn/repo/trunk ...
> No changes
> 71fb4051d840e27a43b87b071ccc7ea70bd0c5e8~1 ==
> 71fb4051d840e27a43b87b071ccc7ea70bd0c5e8
> No changes between current HEAD and refs/remotes/trunk
> Resetting to the latest refs/remotes/trunk
> Unable to extract revision information  from commit
> 867ee195730507fb769e794eb4abe09d0e2e7c8f~1
> 

Shot in the dark (gray): Try

git svn dcommit --no-rebase

> At the same time, it also completely breaks the logs.
> 
> # How to reproduce: (the svn repository just has one commit for usual
> trunk/branches/tags folders)
> $ mkdir foobar
> $ cd foobar/
> $ git init
> Initialized empty Git repository in /home/hr/tmp/foobar/.git/
> $ git commit --allow-empty -m "Project init"
> [master (root-commit) 0f1e71a] Project init
> $ echo "foo" > test.txt; git add test.txt; git commit -m "Initial version"
> [master 119fc0a] Initial version
>  1 files changed, 1 insertions(+), 0 deletions(-)
>  create mode 100644 test.txt
> $ echo "bar" > test.txt; git commit test.txt -m "Second version"
> [master 77b2681] Second version
>  1 files changed, 1 insertions(+), 1 deletions(-)
> $ git svn init -s https://code/svn/foobar/
> $ git svn fetch
> r1 = 8bc83d5d63b4191509d29aa90e35e24edba393c1 (refs/remotes/trunk)
> $ git log --pretty=oneline master
> 77b268140a03cbe98215ea160704ba14ce79e096 Second version
> 119fc0a55d1eb851fcedfe0bdc6de3c1ab047601 Initial version
> 0f1e71a283d7b4b27d23debaac091b654d495124 Project init
> $ git show-ref trunk
> 8bc83d5d63b4191509d29aa90e35e24edba393c1 refs/remotes/trunk
> $ echo "0f1e71a283d7b4b27d23debaac091b654d495124
> 8bc83d5d63b4191509d29aa90e35e24edba393c1" >> .git/info/grafts
> $ git log --pretty=oneline
> 77b268140a03cbe98215ea160704ba14ce79e096 Second version
> 119fc0a55d1eb851fcedfe0bdc6de3c1ab047601 Initial version
> 0f1e71a283d7b4b27d23debaac091b654d495124 Project init
> 8bc83d5d63b4191509d29aa90e35e24edba393c1 * Init project, mkdir trunk branches ta
> $ git svn dcommit
> Committing to https://code/svn/foobar/trunk ...
> No changes
> 0f1e71a283d7b4b27d23debaac091b654d495124~1 ==
> 0f1e71a283d7b4b27d23debaac091b654d495124
> No changes between current HEAD and refs/remotes/trunk
> Resetting to the latest refs/remotes/trunk
> Unable to extract revision information  from commit
> 119fc0a55d1eb851fcedfe0bdc6de3c1ab047601~1
> $ git log
> commit 8bc83d5d63b4191509d29aa90e35e24edba393c1
> Author: root <root@e969a563-e91d-45ef-9946-abb13e32418c>
> Date:   Thu Jul 7 06:40:59 2011 +0000
> 
>     * Init project, mkdir trunk branches tags.
> 
>     git-svn-id: https://code/svn/foobar/trunk@1 e969a563-e91d-45ef-9946-abb13e32
> 
> # Solution:
> Not really a solution but instead of using the first commit for the
> grafts, I use the second one (that is non empty).
> 
> Hope this can help getting a better git-svn!!
> 
> Stefan

^ permalink raw reply

* [PATCH v3] doc/fast-import: document feature import-marks-if-exists
From: Dmitry Ivankov @ 2011-08-17 10:42 UTC (permalink / raw)
  To: git
  Cc: Ramkumar Ramachandra, Johan Herland, Shawn O. Pearce,
	Junio C Hamano, Dmitry Ivankov

fast-import command-line option --import-marks-if-exists was introduced
in commit dded4f1 (fast-import: Introduce --import-marks-if-exists, 2011-01-15)

--import-marks option can be set via a "feature" command in a fast-import
stream and --import-marks-if-exists had support for such specification
from the very beginning too due to some shared codebase. Though the
documentation for this feature wasn't written in dded4f1.

Add the documentation for "feature import-marks-if-exists=<file>". Also add
a minimalistic test for it.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
---
This is a new round for 2/3 from [1]. 1/3 and 3/3 are already in master.
The only change from v2 is more tests, now there are:

- feature import-marks-if-exists=nonexisting.marks
- feature import-marks-if-exists=existing.marks
- --import-marks=existing.marks & feature=nonexisting.marks
- --import-marks-if-exists=nonexisting.marks & feature=existing.marks

These seem to cover most cases: feature works and is overriden by command line arguments.
Having more than one feature specified isn't tested to fail, imo it'd be better to support
specifying multiple marks files via features anyway. It's not yet done because unlike other
simple options are easy to override on the fly (we first parse the stream for features and
then parse argv. So argv overrides things), while import marks are more tricky:
- overriding rule is more complex, any command line option should discard all feature ones.
- reading them could be expensive (we do lookup objects they refer to).
- if the lookup fails or file is otherwise corrupt/bad, we die. So we shouldn't read marks
files given by features if they are to be overriden by command line options.

 Documentation/git-fast-import.txt |   10 +++++--
 t/t9300-fast-import.sh            |   47 +++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 2969388..db0d75f 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -1012,10 +1012,14 @@ force::
 	(see OPTIONS, above).
 
 import-marks::
+import-marks-if-exists::
 	Like --import-marks except in two respects: first, only one
-	"feature import-marks" command is allowed per stream;
-	second, an --import-marks= command-line option overrides
-	any "feature import-marks" command in the stream.
+	"feature import-marks" or "feature import-marks-if-exists"
+	command is allowed per stream; second, an --import-marks=
+	or --import-marks-if-exists command-line option overrides
+	any of these "feature" commands in the stream; third,
+	"feature import-marks-if-exists" like a corresponding
+	command-line option silently skips a nonexistent file.
 
 cat-blob::
 ls::
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index f256475..2cb4494 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -1882,6 +1882,53 @@ test_expect_success 'R: --import-marks-if-exists' '
 	test_cmp expect io.marks
 '
 
+test_expect_success 'R: feature import-marks-if-exists' '
+	rm -f io.marks &&
+	>expect &&
+
+	git fast-import --export-marks=io.marks <<-\EOF &&
+	feature import-marks-if-exists=not_io.marks
+	EOF
+	test_cmp expect io.marks &&
+
+	blob=$(echo hi | git hash-object --stdin) &&
+
+	echo ":1 $blob" >io.marks &&
+	echo ":1 $blob" >expect &&
+	echo ":2 $blob" >>expect &&
+
+	git fast-import --export-marks=io.marks <<-\EOF &&
+	feature import-marks-if-exists=io.marks
+	blob
+	mark :2
+	data 3
+	hi
+
+	EOF
+	test_cmp expect io.marks &&
+
+	echo ":3 $blob" >>expect &&
+
+	git fast-import --import-marks=io.marks \
+			--export-marks=io.marks <<-\EOF &&
+	feature import-marks-if-exists=not_io.marks
+	blob
+	mark :3
+	data 3
+	hi
+
+	EOF
+	test_cmp expect io.marks &&
+
+	>expect &&
+
+	git fast-import --import-marks-if-exists=not_io.marks \
+			--export-marks=io.marks <<-\EOF
+	feature import-marks-if-exists=io.marks
+	EOF
+	test_cmp expect io.marks
+'
+
 cat >input << EOF
 feature import-marks=marks.out
 feature export-marks=marks.new
-- 
1.7.3.4

^ permalink raw reply related

* Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.
From: Matthieu Moy @ 2011-08-17  9:58 UTC (permalink / raw)
  To: vireshk
  Cc: Ramkumar Ramachandra, git@vger.kernel.org, Shiraz HASHIM,
	Vipin KUMAR
In-Reply-To: <4E4B86F1.2010802@st.com>

vireshk <viresh.kumar@st.com> writes:

> Hi Ram,
>
> Actually i did this by mistake once and thought git send-email should
> have taken care of this. I may be wrong, but it was just an thought.

git send-email could probably issue a warning if the same patch is
mentionned twice, but I don't think it's sane to try to silently
autocorrect user's mistake.

If users get used to "git send-email 1.patch 1.patch" sending the email
only once, then what should be the expected behavior of

  git send-email 1.patch ./1.patch

  git send-email 1.patch symlink-to-1.patch

?

The nice thing with a warning is that you can't really blame the tool
for not issuing a warning, while it can be harmfull to have an
autocorrection fail in a real user-senario.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply

* Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.
From: vireshk @ 2011-08-17  9:16 UTC (permalink / raw)
  To: Ramkumar Ramachandra; +Cc: git@vger.kernel.org, Shiraz HASHIM, Vipin KUMAR
In-Reply-To: <CALkWK0nv=NrCzxfePL50GiJya+DbqdOmSMjPVEa-Sf1Qm5oAvg@mail.gmail.com>

On 8/17/2011 2:22 PM, Ramkumar Ramachandra wrote:
> Viresh kumar writes:
>> git send-email --to=abc@xyz.com 0001-xyz.patch 0001-xyz.patch
>>
>> What should be the desired behavior of this command, Should we get
>> mail only once or twice?
> 
> I'd expect it to send out two emails.  Why should 'git send-email'
> check the supplied command-line arguments for duplicates?  I can't
> think of a usecase for it. It's a simple Perl script that mails out
> the mbox files specified on the command-line.  Could you tell us your
> usecase?  If it's a shell script that calls 'git send-email' with
> duplicate arguments, I think you should fix the shell script, not 'git
> send-email'.
> 

Hi Ram,

Actually i did this by mistake once and thought git send-email should
have taken care of this. I may be wrong, but it was just an thought.

--
viresh

^ permalink raw reply

* Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command
From: Ingo Brückl @ 2011-08-17  9:04 UTC (permalink / raw)
  To: git
In-Reply-To: <4e4a58c2.48d6f6ce.bm001@wupperonline.de>

Usually it is annoying that the pager is used for stash list output,
so the config variable pager.stash.list will be utilized now and is
a way to control stash list's behavior.

Signed-off-by: Ingo Brückl <ib@wupperonline.de>
---
 This is the 2nd attempt, now checking for true and false.

 git-stash.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index f4e6f05..3712a17 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -264,7 +264,10 @@ have_stash () {

 list_stash () {
 	have_stash || return 0
-	git log --format="%gd: %gs" -g "$@" $ref_stash --
+	l_config=$(git config --get pager.stash.list)
+	test "$l_config" = "true" && p_option=--paginate
+	test "$l_config" = "false" && p_option=--no-pager
+	git $p_option log --format="%gd: %gs" -g "$@" $ref_stash --
 }

 show_stash () {
--
1.7.6

^ permalink raw reply related

* Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.
From: Ramkumar Ramachandra @ 2011-08-17  8:52 UTC (permalink / raw)
  To: viresh kumar; +Cc: git@vger.kernel.org, Shiraz HASHIM, Vipin KUMAR
In-Reply-To: <4E4B5B9D.1070901@st.com>

Hi Viresh,

Viresh kumar writes:
> git send-email --to=abc@xyz.com 0001-xyz.patch 0001-xyz.patch
>
> What should be the desired behavior of this command, Should we get
> mail only once or twice?

I'd expect it to send out two emails.  Why should 'git send-email'
check the supplied command-line arguments for duplicates?  I can't
think of a usecase for it. It's a simple Perl script that mails out
the mbox files specified on the command-line.  Could you tell us your
usecase?  If it's a shell script that calls 'git send-email' with
duplicate arguments, I think you should fix the shell script, not 'git
send-email'.

Thanks.

-- Ram

^ permalink raw reply

* [PATCH] Disallow creating ambiguous branch names by default
From: Conrad Irwin @ 2011-08-17  8:21 UTC (permalink / raw)
  To: git; +Cc: conrad.irwin

Before this change, it was comparatively easy to create a confusingly
named branch (like "origin/master" or "tag.1"). The former case is
particularly biting to newcomers, who suddenly find themselves needing
to handle nuances of the refs namespaces. The latter is something you're
not likely to want to do, the tag will take precedence when the name is
resolved meaning that your branch will be hard to use.

In both cases, git commands would omit a warning about "ambiguous refs"
if they noticed that this had occurred, however it feels nicer to help
users avoid getting into that situation to start with!

After this patch, git branch <foo>, git checkout -b <foo> and git branch
-m bar <foo> will all fail if <foo> is already a commit-ish; this
safety-net can be removed by passing the -f, -B or -M flags.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>

---

I considered adding a separate configuration variable to disable this
check permanently, but I couldn't find a convincing use-case. Perhaps
the closest is in `git branch $(git describe)` as a quick way to
bookmark a commit; but it seems like creating a tag might be a more
sensible option in that case. Would anyone want such a flag?

Conrad

 Documentation/git-branch.txt |    5 +++--
 branch.c                     |    2 ++
 builtin/branch.c             |    3 +++
 t/t2018-checkout-branch.sh   |   16 ++++++++++++++--
 t/t3200-branch.sh            |   33 +++++++++++++++++++++++++++++++++
 t/t6300-for-each-ref.sh      |    2 +-
 t/t7201-co.sh                |    4 ++--
 7 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index c50f189..415eae3 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -80,8 +80,9 @@ OPTIONS
 
 -f::
 --force::
-	Reset <branchname> to <startpoint> if <branchname> exists
-	already. Without `-f` 'git branch' refuses to change an existing branch.
+	Create the branch even when it might be confusing to do so (for
+	example a tag with that name already exists). If a branch with
+	the same name already exists, it will be reset to <start-point>.
 
 -m::
 	Move/rename a branch and the corresponding reflog.
diff --git a/branch.c b/branch.c
index c0c865a..f26154e 100644
--- a/branch.c
+++ b/branch.c
@@ -162,6 +162,8 @@ void create_branch(const char *head,
 		else if (!is_bare_repository() && head && !strcmp(head, name))
 			die("Cannot force update the current branch.");
 		forcing = 1;
+	} else if (!force && !get_sha1(name, sha1)) {
+		die("A branch named '%s' would be ambiguous.", name);
 	}
 
 	real_ref = NULL;
diff --git a/builtin/branch.c b/builtin/branch.c
index 3142daa..6af1718 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -572,6 +572,9 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 	if (resolve_ref(newref.buf, sha1, 1, NULL) && !force)
 		die(_("A branch named '%s' already exists."), newref.buf + 11);
 
+	if (!get_sha1(newname, sha1) && !force)
+		die(_("A branch named '%s' would be ambiguous."), newname);
+
 	strbuf_addf(&logmsg, "Branch: renamed %s to %s",
 		 oldref.buf, newref.buf);
 
diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh
index a42e039..26cc066 100755
--- a/t/t2018-checkout-branch.sh
+++ b/t/t2018-checkout-branch.sh
@@ -169,15 +169,27 @@ test_expect_success 'checkout -f -B to an existing branch with mergeable changes
 	test_must_fail test_dirty_mergeable
 '
 
-test_expect_success 'checkout -b <describe>' '
+test_expect_success 'checkout -B <describe>' '
 	git tag -f -m "First commit" initial initial &&
 	git checkout -f change1 &&
 	name=$(git describe) &&
-	git checkout -b $name &&
+	git checkout -B $name &&
 	git diff --exit-code change1 &&
 	echo "refs/heads/$name" >expect &&
 	git symbolic-ref HEAD >actual &&
 	test_cmp expect actual
 '
 
+test_expect_success 'checkout -b <tag-name> fails' '
+	git tag -f -m "First commit" initial initial &&
+	git checkout -f change1 &&
+	test_must_fail git checkout -b initial
+'
+
+test_expect_success 'checkout -B <tag-name> fails' '
+	git tag -f -m "First commit" initial initial &&
+	git checkout -f change1 &&
+	git checkout -B initial
+'
+
 test_done
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 9e69c8c..f3f4542 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -230,6 +230,39 @@ test_expect_success \
     'git tag foobar &&
      test_must_fail git branch --track my11 foobar'
 
+test_expect_success 'creating a branch called HEAD fails' '
+    test_must_fail git branch HEAD
+'
+
+test_expect_success 'creating a branch with an ambiguous name fails' '
+    git tag t/g &&
+    test_must_fail git branch t/g &&
+    git tag -d t/g
+'
+
+test_expect_success 'creating a branch with an ambigious name with -f' '
+    git tag t/g &&
+    git branch -f t/g &&
+    git branch -d t/g &&
+    git tag -d t/g
+'
+
+test_expect_success 'moving a branch to an ambiguous name with -m fails' '
+    git tag t/g &&
+    git branch bar &&
+    test_must_fail git branch -m bar t/g &&
+    git branch -d bar &&
+    git tag -d t/g
+'
+
+test_expect_success 'moving a branch to an ambiguous name with -M' '
+    git tag t/g &&
+    git branch b/h &&
+    git branch -M b/h t/g &&
+    git branch -d t/g &&
+    git tag -d t/g
+'
+
 # Keep this test last, as it changes the current branch
 cat >expect <<EOF
 $_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 7dc8a51..37f0394 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -344,7 +344,7 @@ EOF
 test_expect_success 'Check ambiguous head and tag refs II (loose)' '
 	git checkout master &&
 	git tag ambiguous testtag^0 &&
-	git branch ambiguous testtag^0 &&
+	git branch -f ambiguous testtag^0 &&
 	git for-each-ref --format "%(refname:short)" refs/heads/ambiguous refs/tags/ambiguous >actual &&
 	test_cmp expected actual
 '
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 07fb53a..a488c5b 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -311,7 +311,7 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
 test_expect_success 'checkout with ambiguous tag/branch names' '
 
 	git tag both side &&
-	git branch both master &&
+	git branch -f both master &&
 	git reset --hard &&
 	git checkout master &&
 
@@ -330,7 +330,7 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 	git checkout master &&
 
 	git tag frotz side &&
-	git branch frotz master &&
+	git branch -f frotz master &&
 	git reset --hard &&
 	git checkout master &&
 
-- 
1.7.6.448.gc60f1

^ permalink raw reply related

* Issue: Mails sent twice if patch is mentioned twice while sending mail.
From: viresh kumar @ 2011-08-17  6:11 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: Shiraz HASHIM, Vipin KUMAR

Hello,

I found something which look wrong to me, but may not be wrong.
Suppose if we do:

git send-email --to=abc@xyz.com 0001-xyz.patch 0001-xyz.patch

What should be the desired behavior of this command, Should we get
mail only once or twice?

Currently we are getting it twice.

-- 
viresh

^ permalink raw reply

* Re: [PATCH v2] xdiff/xprepare: improve O(n*m) performance in xdl_cleanup_records()
From: Jeff King @ 2011-08-17  5:21 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: Git Mailing List, Junio C Hamano, Marat Radchenko
In-Reply-To: <1313546037-4104-1-git-send-email-rctay89@gmail.com>

On Wed, Aug 17, 2011 at 09:53:57AM +0800, Tay Ray Chuan wrote:

> > Could we have some benchmarks to let the readers get a feel of how much
> > improvement this patch brings in?
> 
> On my msysgit machine with Marat's problematic repo
> (git://slonopotamus.org/git-diff):
> 
>  rctay@TEST-123 /tmp/slono
>  $ time git show >/dev/null
> 
>  real    0m8.538s
>  user    0m0.000s
>  sys     0m0.031s
> 
>  rctay@TEST-123 /tmp/slono
>  $ time /git/git show >/dev/null
> 
>  real    0m0.672s
>  user    0m0.031s
>  sys     0m0.031s

Wait, what? It was using 0 seconds of user time before, but still taking
8.5 seconds? What was it doing? Did you actually warm up your disk cache
before taking these measurements?

-Peff

^ permalink raw reply

* Re: shallow clone not very shallow due to tags
From: Nguyen Thai Ngoc Duy @ 2011-08-17  2:49 UTC (permalink / raw)
  To: Shawn Pearce; +Cc: git
In-Reply-To: <CAJo=hJv_NnZyGnedTQBL_mj3baS8O5Z2wiEbZCvv8305No4ehA@mail.gmail.com>

On Tue, Aug 16, 2011 at 12:16 AM, Shawn Pearce > Yes, I think a user
who is making a shallow clone should only get the
> HEAD branch to the depth specified, nothing else. If they want
> additional branches, they should either pass them on the command line
> to a new flag for clone, or modify their fetch configuration
> after-the-fact and fetch those separately.

I'd like maintain all refs of the repo, even though we though we only
have objects for one branch. If I do a shallow clone and want to
change branch, I could just list available branch locally instead of
going to gitweb.somewhere for the branch name.

Do we have someway to represent a ref placeholder?
-- 
Duy

^ permalink raw reply

* Re: [PATCH 2/2] diffcore-pickaxe: terminate grepping as soon as it hits
From: Nguyen Thai Ngoc Duy @ 2011-08-17  2:44 UTC (permalink / raw)
  To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy
In-Reply-To: <1313376083-24713-2-git-send-email-pclouds@gmail.com>

diffgrep_consume() already stops regexec() after hitting, so the value
of this series is negligible. Tay Ray Chuan seems to touch xdiff code
too and my changes are across many files. I'll drop this series.

2011/8/15 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  diffcore-pickaxe.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
> index 12811b9..e028dd5 100644
> --- a/diffcore-pickaxe.c
> +++ b/diffcore-pickaxe.c
> @@ -21,11 +21,7 @@ static int diffgrep_consume(void *priv, char *line, unsigned long len)
>        if (line[0] != '+' && line[0] != '-')
>                return 0;
>        if (data->hit)
> -               /*
> -                * NEEDSWORK: we should have a way to terminate the
> -                * caller early.
> -                */
> -               return 0;
> +               return -1;
>        /* Yuck -- line ought to be "const char *"! */
>        hold = line[len];
>        line[len] = '\0';
> --
> 1.7.4.74.g639db
>
>



-- 
Duy

^ permalink raw reply

* Re: [PATCH 1/2] xdiff-interface: allow consume function to quit early by returning non-zero
From: Nguyen Thai Ngoc Duy @ 2011-08-17  2:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v39h2laxb.fsf@alter.siamese.dyndns.org>

2011/8/16 Junio C Hamano <gitster@pobox.com>:
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>
> What is this for? No explanation?

Um.. for stopping emitting diff when the consumer feels enough and
wants no more. Will update.

>> @@ -64,10 +64,12 @@ static void consume_one(void *priv_, char *s, unsigned long size)
>>               unsigned long this_size;
>>               ep = memchr(s, '\n', size);
>>               this_size = (ep == NULL) ? size : (ep - s + 1);
>> -             priv->consume(priv->consume_callback_data, s, this_size);
>> +             if (priv->consume(priv->consume_callback_data, s, this_size))
>> +                     return -1;
>>               size -= this_size;
>>               s += this_size;
>>       }
>> +     return 0;
>>  }
>
> Returning a negative value implies that this is an error condition. Should
> all "non-zero" returns from ->consume necessarily be considered error?

Perhaps negative values only, like how xdiff treats it.
-- 
Duy

^ permalink raw reply

* Re: [PATCH] update-index: add --swap to swap index and worktree content
From: Jeff King @ 2011-08-17  2:17 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, git
In-Reply-To: <CACsJy8Ad4xPz79jT3O64c3XsCeM8XETJ9bnjK0aisagrYN0CMA@mail.gmail.com>

On Wed, Aug 17, 2011 at 09:11:32AM +0700, Nguyen Thai Ngoc Duy wrote:

> I blame git for training me always do "git diff" before update index.
> But if we add "add -e", I could also make "add -e -p" work, (edit
> temporary file first, then fall back to interactive mode and let me
> review my changes).

Yeah, that would be cool. But note that "git add -e" already exists for
patch editing.

> Two reasons. I already mentioned the ability to quickly checkout index
> for a quick test (though there could be more problems down that road).

That's a good thought. However, in practice, I find I also need other
files from the index to do a successful test. So I end up just
committing what I think is right, and then afterwards do:

  GIT_EDITOR='sed -i "/^pick .*/aexec make test/"' git rebase -i

to test and fixup each commit individually.

You could probably use "checkout-index" to create a pristine workspace
to test. It's a little inefficient to write out all of the files again,
but probably the actual build and test procedure would be much more
expensive, anyway.

-Peff

^ permalink raw reply

* Re: [PATCH] update-index: add --swap to swap index and worktree content
From: Nguyen Thai Ngoc Duy @ 2011-08-17  2:11 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git
In-Reply-To: <20110816230654.GA21793@sigill.intra.peff.net>

2011/8/17 Jeff King <peff@peff.net>:
>> As a way to punt from making "add -e" usable, I'd think it would be a
>> workable q&d workaround, even though it feels wrong, and I would imagine
>> that normal people would probably prefer the "check out to a temporary
>> file to be edited" solution you wrote in your previous message.
>
> Yeah, I think that is the sanest of the options brought up in this

I blame git for training me always do "git diff" before update index.
But if we add "add -e", I could also make "add -e -p" work, (edit
temporary file first, then fall back to interactive mode and let me
review my changes).

> thread. I'm curious if Duy had another use case, though, that made him
> think of --swap.

Two reasons. I already mentioned the ability to quickly checkout index
for a quick test (though there could be more problems down that road).

The other one could be done another way too. I translation
coordinator. When a translator sends their translations to me, I'd
pick good translations and commit them, leaving the rest for
discussion. This is why I don't want to touch wt. While adding
translations to index, I may find a mistake in current translation
(ie. in index) and want to fix it too.
-- 
Duy

^ permalink raw reply

* [PATCH/RFC] Disallow NULL in struct commit_list
From: Nguyễn Thái Ngọc Duy @ 2011-08-17  2:01 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

It seems to me that in most cases commit_list is supposed to contain
real commits. If someone puts a NULL there by accident, it'd be hard to
track down because sigsegv would happen later when the the commit is
used, not when added.

So perhaps we could safeguard commit_list_insert(). If a bug tries to
put NULL in, it'd be caught earlier.

There is code that add NULL commit on purpose, "make test" only catches
one in revert.c, but I may miss other cases and crash system unnecessarily.

Not sure if this patch is worth the trouble. Maybe make it permanent
resident of next and never graduate to master?

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/merge.c  |    2 +-
 builtin/revert.c |    2 +-
 commit.c         |    3 +++
 commit.h         |    2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 325891e..158008d 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -611,7 +611,7 @@ static void write_tree_trivial(unsigned char *sha1)
 
 static const char *merge_argument(struct commit *commit)
 {
-	if (commit)
+	if (commit && commit != &null_commit)
 		return sha1_to_hex(commit->object.sha1);
 	else
 		return EMPTY_TREE_SHA1_HEX;
diff --git a/builtin/revert.c b/builtin/revert.c
index 1f27c63..7d5005e 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -471,7 +471,7 @@ static int do_pick_commit(void)
 		}
 		strbuf_addstr(&msgbuf, ".\n");
 	} else {
-		base = parent;
+		base = parent ? parent : &null_commit;
 		base_label = msg.parent_label;
 		next = commit;
 		next_label = msg.label;
diff --git a/commit.c b/commit.c
index dc22695..604d2f1 100644
--- a/commit.c
+++ b/commit.c
@@ -11,6 +11,8 @@ int save_commit_buffer = 1;
 
 const char *commit_type = "commit";
 
+struct commit null_commit;
+
 static struct commit *check_commit(struct object *obj,
 				   const unsigned char *sha1,
 				   int quiet)
@@ -363,6 +365,7 @@ int find_commit_subject(const char *commit_buffer, const char **subject)
 struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p)
 {
 	struct commit_list *new_list = xmalloc(sizeof(struct commit_list));
+	assert(item != NULL);
 	new_list->item = item;
 	new_list->next = *list_p;
 	*list_p = new_list;
diff --git a/commit.h b/commit.h
index 0e36fd0..c9f0743 100644
--- a/commit.h
+++ b/commit.h
@@ -21,6 +21,8 @@ struct commit {
 	char *buffer;
 };
 
+extern struct commit null_commit;
+
 extern int save_commit_buffer;
 extern const char *commit_type;
 
-- 
1.7.4.74.g639db

^ permalink raw reply related

* [PATCH v2] xdiff/xprepare: improve O(n*m) performance in xdl_cleanup_records()
From: Tay Ray Chuan @ 2011-08-17  1:53 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Marat Radchenko
In-Reply-To: <7vd3g5i7ci.fsf@alter.siamese.dyndns.org>

In xdl_cleanup_records(), we see O(n*m) performance, where n is the
number of records from xdf->dstart to xdf->dend, and m is the size of a
bucket in xdf->rhash (<= by mlim).

Here, we improve this to O(n) by pre-computing nm (in rcrec->len(1|2))
in xdl_classify_record().

Reported-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---

Changed in v2:
 - free() xdlclassifier_t->rcrecs

On Wed, Aug 17, 2011 at 1:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Tay Ray Chuan <rctay89@gmail.com> writes:
>
>> From 0da9ec94604978f877e7f7c00d307b5cdbb22b29 Mon Sep 17 00:00:00 2001
>> From: Tay Ray Chuan <rctay89@gmail.com>
>> Date: Tue, 16 Aug 2011 11:35:28 +0800
>> Subject: [PATCH] xdiff/xprepare: improve O(n*m) performance in
>> ?xdl_cleanup_records()
>
> You do not need these four lines. Thanks.

Oops, I directly pasted git-format-patch output into Claws-mail, sorry
about that.

>> In xdl_cleanup_records(), we see O(n*m) performance, where n is the
>> number of records from xdf->dstart to xdf->dend, and m is the size of a
>> bucket in xdf->rhash (<= by mlim).
>>
>> Here, we improve this to O(n) by pre-computing nm (in rcrec->len(1|2))
>> in xdl_classify_record().
>
> Could we have some benchmarks to let the readers get a feel of how much
> improvement this patch brings in?

On my msysgit machine with Marat's problematic repo
(git://slonopotamus.org/git-diff):

 rctay@TEST-123 /tmp/slono
 $ time git show >/dev/null

 real    0m8.538s
 user    0m0.000s
 sys     0m0.031s

 rctay@TEST-123 /tmp/slono
 $ time /git/git show >/dev/null

 real    0m0.672s
 user    0m0.031s
 sys     0m0.031s

> This tries to trade cycles with memory, right? How much bloat are we
> talking about here?

The main source of memory bloat would be the xdlclassifier_t->rcrecs
lookup table. This is needed to find the classifier record (xdlclass_t)
associated with a xrecord_t.

In an earlier iteration, I had a pointer on each xrecord_t to the
classifier record, instead of a lookup table, but I casted it to void*,
since I wasn't sure if the xdlclass_t definition should be shifted to
xtypes.h (and thus made public to xdiff and git).

The first is cleaner but the second is lighter. I'd appreciate comments
on this.

 xdiff/xprepare.c |   86 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 50 insertions(+), 36 deletions(-)

diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c
index 1689085..05a8f01 100644
--- a/xdiff/xprepare.c
+++ b/xdiff/xprepare.c
@@ -34,6 +34,7 @@ typedef struct s_xdlclass {
 	char const *line;
 	long size;
 	long idx;
+	long len1, len2;
 } xdlclass_t;

 typedef struct s_xdlclassifier {
@@ -41,6 +42,8 @@ typedef struct s_xdlclassifier {
 	long hsize;
 	xdlclass_t **rchash;
 	chastore_t ncha;
+	xdlclass_t **rcrecs;
+	long alloc;
 	long count;
 	long flags;
 } xdlclassifier_t;
@@ -50,15 +53,15 @@ typedef struct s_xdlclassifier {

 static int xdl_init_classifier(xdlclassifier_t *cf, long size, long flags);
 static void xdl_free_classifier(xdlclassifier_t *cf);
-static int xdl_classify_record(xdlclassifier_t *cf, xrecord_t **rhash, unsigned int hbits,
-			       xrecord_t *rec);
-static int xdl_prepare_ctx(mmfile_t *mf, long narec, xpparam_t const *xpp,
+static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t **rhash,
+			       unsigned int hbits, xrecord_t *rec);
+static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_t const *xpp,
 			   xdlclassifier_t *cf, xdfile_t *xdf);
 static void xdl_free_ctx(xdfile_t *xdf);
 static int xdl_clean_mmatch(char const *dis, long i, long s, long e);
-static int xdl_cleanup_records(xdfile_t *xdf1, xdfile_t *xdf2);
+static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xdf2);
 static int xdl_trim_ends(xdfile_t *xdf1, xdfile_t *xdf2);
-static int xdl_optimize_ctxs(xdfile_t *xdf1, xdfile_t *xdf2);
+static int xdl_optimize_ctxs(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xdf2);



@@ -83,6 +86,14 @@ static int xdl_init_classifier(xdlclassifier_t *cf, long size, long flags) {
 	for (i = 0; i < cf->hsize; i++)
 		cf->rchash[i] = NULL;

+	cf->alloc = size;
+	if (!(cf->rcrecs = (xdlclass_t **) xdl_malloc(cf->alloc * sizeof(xdlclass_t *)))) {
+
+		xdl_free(cf->rchash);
+		xdl_cha_free(&cf->ncha);
+		return -1;
+	}
+
 	cf->count = 0;

 	return 0;
@@ -91,16 +102,18 @@ static int xdl_init_classifier(xdlclassifier_t *cf, long size, long flags) {

 static void xdl_free_classifier(xdlclassifier_t *cf) {

+	xdl_free(cf->rcrecs);
 	xdl_free(cf->rchash);
 	xdl_cha_free(&cf->ncha);
 }


-static int xdl_classify_record(xdlclassifier_t *cf, xrecord_t **rhash, unsigned int hbits,
-			       xrecord_t *rec) {
+static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t **rhash,
+			       unsigned int hbits, xrecord_t *rec) {
 	long hi;
 	char const *line;
 	xdlclass_t *rcrec;
+	xdlclass_t **rcrecs;

 	line = rec->ptr;
 	hi = (long) XDL_HASHLONG(rec->ha, cf->hbits);
@@ -116,13 +129,25 @@ static int xdl_classify_record(xdlclassifier_t *cf, xrecord_t **rhash, unsigned
 			return -1;
 		}
 		rcrec->idx = cf->count++;
+		if (cf->count > cf->alloc) {
+			cf->alloc *= 2;
+			if (!(rcrecs = (xdlclass_t **) xdl_realloc(cf->rcrecs, cf->alloc * sizeof(xdlclass_t *)))) {
+
+				return -1;
+			}
+			cf->rcrecs = rcrecs;
+		}
+		cf->rcrecs[rcrec->idx] = rcrec;
 		rcrec->line = line;
 		rcrec->size = rec->size;
 		rcrec->ha = rec->ha;
+		rcrec->len1 = rcrec->len2 = 0;
 		rcrec->next = cf->rchash[hi];
 		cf->rchash[hi] = rcrec;
 	}

+	(pass == 1) ? rcrec->len1++ : rcrec->len2++;
+
 	rec->ha = (unsigned long) rcrec->idx;

 	hi = (long) XDL_HASHLONG(rec->ha, hbits);
@@ -133,7 +158,7 @@ static int xdl_classify_record(xdlclassifier_t *cf, xrecord_t **rhash, unsigned
 }


-static int xdl_prepare_ctx(mmfile_t *mf, long narec, xpparam_t const *xpp,
+static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_t const *xpp,
 			   xdlclassifier_t *cf, xdfile_t *xdf) {
 	unsigned int hbits;
 	long i, nrec, hsize, bsize;
@@ -200,7 +225,7 @@ static int xdl_prepare_ctx(mmfile_t *mf, long narec, xpparam_t const *xpp,
 			crec->ha = hav;
 			recs[nrec++] = crec;

-			if (xdl_classify_record(cf, rhash, hbits, crec) < 0) {
+			if (xdl_classify_record(pass, cf, rhash, hbits, crec) < 0) {

 				xdl_free(rhash);
 				xdl_free(recs);
@@ -276,28 +301,28 @@ int xdl_prepare_env(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
 		return -1;
 	}

-	if (xdl_prepare_ctx(mf1, enl1, xpp, &cf, &xe->xdf1) < 0) {
+	if (xdl_prepare_ctx(1, mf1, enl1, xpp, &cf, &xe->xdf1) < 0) {

 		xdl_free_classifier(&cf);
 		return -1;
 	}
-	if (xdl_prepare_ctx(mf2, enl2, xpp, &cf, &xe->xdf2) < 0) {
+	if (xdl_prepare_ctx(2, mf2, enl2, xpp, &cf, &xe->xdf2) < 0) {

 		xdl_free_ctx(&xe->xdf1);
 		xdl_free_classifier(&cf);
 		return -1;
 	}

-	xdl_free_classifier(&cf);
-
 	if (!(xpp->flags & XDF_PATIENCE_DIFF) &&
-			xdl_optimize_ctxs(&xe->xdf1, &xe->xdf2) < 0) {
+			xdl_optimize_ctxs(&cf, &xe->xdf1, &xe->xdf2) < 0) {

 		xdl_free_ctx(&xe->xdf2);
 		xdl_free_ctx(&xe->xdf1);
 		return -1;
 	}

+	xdl_free_classifier(&cf);
+
 	return 0;
 }

@@ -372,11 +397,10 @@ static int xdl_clean_mmatch(char const *dis, long i, long s, long e) {
  * matches on the other file. Also, lines that have multiple matches
  * might be potentially discarded if they happear in a run of discardable.
  */
-static int xdl_cleanup_records(xdfile_t *xdf1, xdfile_t *xdf2) {
-	long i, nm, rhi, nreff, mlim;
-	unsigned long hav;
+static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xdf2) {
+	long i, nm, nreff;
 	xrecord_t **recs;
-	xrecord_t *rec;
+	xdlclass_t *rcrec;
 	char *dis, *dis1, *dis2;

 	if (!(dis = (char *) xdl_malloc(xdf1->nrec + xdf2->nrec + 2))) {
@@ -387,26 +411,16 @@ static int xdl_cleanup_records(xdfile_t *xdf1, xdfile_t *xdf2) {
 	dis1 = dis;
 	dis2 = dis1 + xdf1->nrec + 1;

-	if ((mlim = xdl_bogosqrt(xdf1->nrec)) > XDL_MAX_EQLIMIT)
-		mlim = XDL_MAX_EQLIMIT;
 	for (i = xdf1->dstart, recs = &xdf1->recs[xdf1->dstart]; i <= xdf1->dend; i++, recs++) {
-		hav = (*recs)->ha;
-		rhi = (long) XDL_HASHLONG(hav, xdf2->hbits);
-		for (nm = 0, rec = xdf2->rhash[rhi]; rec; rec = rec->next)
-			if (rec->ha == hav && ++nm == mlim)
-				break;
-		dis1[i] = (nm == 0) ? 0: (nm >= mlim) ? 2: 1;
+		rcrec = cf->rcrecs[(*recs)->ha];
+		nm = rcrec ? rcrec->len2 : 0;
+		dis1[i] = (nm == 0) ? 0: 1;
 	}

-	if ((mlim = xdl_bogosqrt(xdf2->nrec)) > XDL_MAX_EQLIMIT)
-		mlim = XDL_MAX_EQLIMIT;
 	for (i = xdf2->dstart, recs = &xdf2->recs[xdf2->dstart]; i <= xdf2->dend; i++, recs++) {
-		hav = (*recs)->ha;
-		rhi = (long) XDL_HASHLONG(hav, xdf1->hbits);
-		for (nm = 0, rec = xdf1->rhash[rhi]; rec; rec = rec->next)
-			if (rec->ha == hav && ++nm == mlim)
-				break;
-		dis2[i] = (nm == 0) ? 0: (nm >= mlim) ? 2: 1;
+		rcrec = cf->rcrecs[(*recs)->ha];
+		nm = rcrec ? rcrec->len1 : 0;
+		dis2[i] = (nm == 0) ? 0: 1;
 	}

 	for (nreff = 0, i = xdf1->dstart, recs = &xdf1->recs[xdf1->dstart];
@@ -468,10 +482,10 @@ static int xdl_trim_ends(xdfile_t *xdf1, xdfile_t *xdf2) {
 }


-static int xdl_optimize_ctxs(xdfile_t *xdf1, xdfile_t *xdf2) {
+static int xdl_optimize_ctxs(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xdf2) {

 	if (xdl_trim_ends(xdf1, xdf2) < 0 ||
-	    xdl_cleanup_records(xdf1, xdf2) < 0) {
+	    xdl_cleanup_records(cf, xdf1, xdf2) < 0) {

 		return -1;
 	}
--
1.7.6.12.g6486a.dirty

^ permalink raw reply related

* [PATCH v2] commit: accept tag objects in HEAD/MERGE_HEAD
From: Nguyễn Thái Ngọc Duy @ 2011-08-17  1:42 UTC (permalink / raw)
  To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy
In-Reply-To: <1313422716-26432-1-git-send-email-pclouds@gmail.com>

HEAD, MERGE_HEAD (or any other branches) should only have SHA-1 of a
commit object. However broken tools can put a tag object there. While
it's wrong, it'd be better to tolerate the situation and move on
("commit" is an often used operation, unable to commit could be bad).

In worse cases, where we cannot even resolve HEAD to a commit, die()
instead of segfault.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/commit.c |   15 +++++++++------
 commit.c         |   12 ++++++++++++
 commit.h         |    1 +
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 2088b6b..f327595 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1387,6 +1387,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	unsigned char commit_sha1[20];
 	struct ref_lock *ref_lock;
 	struct commit_list *parents = NULL, **pptr = &parents;
+	struct commit *commit;
 	struct stat statbuf;
 	int allow_fast_forward = 1;
 	struct wt_status s;
@@ -1423,12 +1424,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 			reflog_msg = "commit (initial)";
 	} else if (amend) {
 		struct commit_list *c;
-		struct commit *commit;
 
 		if (!reflog_msg)
 			reflog_msg = "commit (amend)";
-		commit = lookup_commit(head_sha1);
-		if (!commit || parse_commit(commit))
+		commit = lookup_expect_commit(head_sha1, "HEAD");
+		if (parse_commit(commit))
 			die(_("could not parse HEAD commit"));
 
 		for (c = commit->parents; c; c = c->next)
@@ -1439,7 +1439,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 		if (!reflog_msg)
 			reflog_msg = "commit (merge)";
-		pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
+		commit = lookup_expect_commit(head_sha1, "HEAD");
+		pptr = &commit_list_insert(commit, pptr)->next;
 		fp = fopen(git_path("MERGE_HEAD"), "r");
 		if (fp == NULL)
 			die_errno(_("could not open '%s' for reading"),
@@ -1448,7 +1449,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 			unsigned char sha1[20];
 			if (get_sha1_hex(m.buf, sha1) < 0)
 				die(_("Corrupt MERGE_HEAD file (%s)"), m.buf);
-			pptr = &commit_list_insert(lookup_commit(sha1), pptr)->next;
+			commit = lookup_expect_commit(sha1, "MERGE_HEAD");
+			pptr = &commit_list_insert(commit, pptr)->next;
 		}
 		fclose(fp);
 		strbuf_release(&m);
@@ -1465,7 +1467,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 			reflog_msg = (whence == FROM_CHERRY_PICK)
 					? "commit (cherry-pick)"
 					: "commit";
-		pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
+		commit = lookup_expect_commit(head_sha1, "HEAD");
+		pptr = &commit_list_insert(commit, pptr)->next;
 	}
 
 	/* Finally, get the commit message */
diff --git a/commit.c b/commit.c
index ac337c7..dc22695 100644
--- a/commit.c
+++ b/commit.c
@@ -39,6 +39,18 @@ struct commit *lookup_commit_reference(const unsigned char *sha1)
 	return lookup_commit_reference_gently(sha1, 0);
 }
 
+struct commit *lookup_expect_commit(const unsigned char *sha1,
+				    const char *ref_name)
+{
+	struct commit *c = lookup_commit_reference(sha1);
+	if (!c)
+		die(_("could not parse %s"), ref_name);
+	if (hashcmp(sha1, c->object.sha1))
+		warning(_("%s %s is not a commit!"),
+			ref_name, sha1_to_hex(sha1));
+	return c;
+}
+
 struct commit *lookup_commit(const unsigned char *sha1)
 {
 	struct object *obj = lookup_object(sha1);
diff --git a/commit.h b/commit.h
index feb809f..0e36fd0 100644
--- a/commit.h
+++ b/commit.h
@@ -37,6 +37,7 @@ struct commit *lookup_commit_reference(const unsigned char *sha1);
 struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
 					      int quiet);
 struct commit *lookup_commit_reference_by_name(const char *name);
+struct commit *lookup_expect_commit(const unsigned char *sha1, const char *ref_name);
 
 int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size);
 int parse_commit(struct commit *item);
-- 
1.7.4.74.g639db

^ permalink raw reply related

* Re: [PATCH] commit: check return value of lookup_commit()
From: Nguyen Thai Ngoc Duy @ 2011-08-17  1:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy5ytgrps.fsf@alter.siamese.dyndns.org>

On Wed, Aug 17, 2011 at 1:02 AM, Junio C Hamano >> But then I would
need to avoid die()ing in "initial_commit" case.
>
> That's exactly what I said.
>
>        if (!initial)
>                /* we need to know the head_commit */
>                head_commit = lookup_and_check(HEAD);
>
>        /* depending on what kind of commit, we need different stuff */
>        if (initial)
>                ... going to create a parentless commit
>        else if (amending)
>                ... use the head_commit to learn parent, reuse the message
>                ... from there
>        else if ...
>
> These two are independent if/else cascades in the sense that the first is
> about learning the details of head_commit, and the latter is about
> learning how the commit is done, and in a subset of the latter head_commit
> is used.

And some months from now, someone may add more code in between the two
"if" blocks. Some more months past, someone tweaks the "if (initial)"
block but forgets to also update the "if (!initial)" above. This is
what I want to avoid.
-- 
Duy

^ permalink raw reply

* Re: [PATCH/RFC] git-svn: remove auto_abbrev (Getopt::Long option)
From: Eric Wong @ 2011-08-17  1:02 UTC (permalink / raw)
  To: Piotr Krukowiecki; +Cc: Git Mailing List
In-Reply-To: <4E46DF9C.8040900@gmail.com>

Piotr Krukowiecki <piotr.krukowiecki@gmail.com> wrote:
> RFC because this changes user interface (no option abbreviation),
> but I know no other good way to fix the --author problem.
> 
> The --author option would be useful, because I usually use
>   git svn log --oneline
> and paste the changes with svn revision numbers to bugzilla etc.
> 
> All tests pass with this change.

How about minimizing the impact and potential breakage with this?

(I'm not sure if "blame" benefits/hurts from this, I almost never
use any form of it)

diff --git a/git-svn.perl b/git-svn.perl
index 96f373f..ba382eb 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -298,6 +298,9 @@ my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
 read_git_config(\%opts);
 if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
 	Getopt::Long::Configure('pass_through');
+	if ($cmd eq 'log') {
+		Getopt::Long::Configure('no_auto_abbrev');
+	}
 }
 my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
                     'minimize-connections' => \$Git::SVN::Migration::_minimize,
-- 
Eric Wong

^ permalink raw reply related

* Re: [PATCH v2] git svn : hook before 'git svn dcommit'
From: Eric Wong @ 2011-08-17  0:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Frédéric Heitzmann, git
In-Reply-To: <7vty9ijs1i.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> wrote:
> Frédéric Heitzmann  <frederic.heitzmann@gmail.com> writes:
> 
> > The 'pre-svn-dcommit' hook is called before 'git svn dcommit', which aborts
> > if return value is not zero. The only parameter given to the hook is the
> > reference given to 'git svn dcommit'. If no paramter was used, hook gets HEAD
> > as its only parameter.
> 
> It appears that this is in the same spirit as the pre-commit hook used in
> "git commit", so it may not hurt but I do not know if having a separate
> hook is the optimal approach to achieve what it wants to do.
> 
> I notice that git-svn users have been happily using the subsystem without
> need for any hook (not just pre-commit). Does "git svn" need an equivalent
> of pre-commit hook? If so, does it need equivalents to other hooks as
> well? I am not suggesting you to add support for a boatload of other hooks
> in this patch---I am trying to see if this is really a necessary change to
> begin with.
> 
> Eric, do you want this one?

I'm not sure.  I feel hooks should be avoided whenever possible, and
a git-svn-specific hook for dcommit wouldn't place the same restriction
as a server-side SVN hook for svn(1) users.

Preventing certain commits from accidentally hitting the SVN server can
be useful, I think.  On the other hand, I'm not sure if people who run
accidental dcommits would remember to the pre-dcommit hook, either.

Perhaps an interactive option for dcommit would be just as useful?

Test cases are required for any new features of git-svn, though.

> > +	system($hook, $head);
> > +	if ($? == -1) {
> > +		print "[pre_svn_dcommit_hook] failed to execute $hook: $!\n";
> > +		return 1;
> > +	} elsif ($? & 127) {
> > +		printf "[pre_svn_dcommit_hook] child died with signal %d, %s coredump\n",
> > +		($? & 127),  ($? & 128) ? 'with' : 'without';
> > +		return 1;
> > +	} else {
> > +		return $? >> 8;
> > +	}
> > +}
> 
> Should these messages go to the standard output?

Failure messages should definitely go to stderr.

-- 
Eric Wong

^ permalink raw reply

* What's cooking in git.git (Aug 2011, #04; Tue, 16)
From: Junio C Hamano @ 2011-08-17  0:07 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'.

The kernel.org machine seems to be very busy for the past 48 hours and it
might take a while for tonight's pushout to propagate to its public
mirrors. It may be faster to fetch from repo.or.gz, github, sourceforge,
or code.google.com mirrors, e.g.

    git://repo.or.cz/alt-git.git/
    git://github.com/gitster/git
    https://code.google.com/p/git-core/

There are a few 'fixup!' commits queued in topics still in 'pu', so that
authors have a choice to just say "that fix looks good, squash it in!"
instead of going through an extra round.

--------------------------------------------------
[New Topics]

* di/fast-import-deltified-tree (2011-08-14) 2 commits
 - fast-import: prevent producing bad delta
 - fast-import: add a test for tree delta base corruption

* di/parse-options-split (2011-08-11) 2 commits
 - Reduce parse-options.o dependencies
 - parse-options: export opterr, optbug

* mh/attr (2011-08-14) 7 commits
 - Unroll the loop over passes
 - Change while loop into for loop
 - Determine the start of the states outside of the pass loop
 - Change parse_attr() to take a pointer to struct attr_state
 - Increment num_attr in parse_attr_line(), not parse_attr()
 - Document struct match_attr
 - Add a file comment

All looked reasonable.

* mh/iterate-refs (2011-08-14) 6 commits
 - Retain caches of submodule refs
 - Store the submodule name in struct cached_refs
 - Allocate cached_refs objects dynamically
 - Change the signature of read_packed_refs()
 - Access reference caches only through new function get_cached_refs()
 - Extract a function clear_cached_refs()

* jn/plug-empty-tree-leak (2011-08-16) 2 commits
 - merge-recursive: take advantage of hardcoded empty tree
 - revert: plug memory leak in "cherry-pick root commit" codepath

Both looked reasonable.

--------------------------------------------------
[Stalled]

* jc/merge-reword (2011-05-25) 2 commits
 - merge: mark the final "Merge made by..." message for l10n
 - merge: reword the final message

Probably the topmost commit should be dropped.

* nk/branch-v-abbrev (2011-07-01) 1 commit
 - branch -v: honor core.abbrev

Perhaps needs an updated commit log message?

* di/fast-import-doc (2011-07-13) 2 commits
 - doc/fast-import: document feature import-marks-if-exists
 - doc/fast-import: clarify notemodify command

Comments from fast-import folks?

* jh/receive-count-limit (2011-05-23) 10 commits
 - receive-pack: Allow server to refuse pushes with too many objects
 - pack-objects: Estimate pack size; abort early if pack size limit is exceeded
 - send-pack/receive-pack: Allow server to refuse pushing too large packs
 - pack-objects: Allow --max-pack-size to be used together with --stdout
 - send-pack/receive-pack: Allow server to refuse pushes with too many commits
 - pack-objects: Teach new option --max-commit-count, limiting #commits in pack
 - receive-pack: Prepare for addition of the new 'limit-*' family of capabilities
 - Tighten rules for matching server capabilities in server_supports()
 - send-pack: Attempt to retrieve remote status even if pack-objects fails
 - Update technical docs to reflect side-band-64k capability in receive-pack

Would need another round to separate per-pack and per-session limits.

* jm/mergetool-pathspec (2011-06-22) 2 commits
 - mergetool: Don't assume paths are unmerged
 - mergetool: Add tests for filename with whitespace

I think this is a good idea, but it probably needs a re-roll.
Cf. $gmane/176254, 176255, 166256

* jk/generation-numbers (2011-07-14) 7 commits
 - limit "contains" traversals based on commit generation
 - check commit generation cache validity against grafts
 - pretty: support %G to show the generation number of a commit
 - commit: add commit_generation function
 - add metadata-cache infrastructure
 - decorate: allow storing values instead of pointers
 - Merge branch 'jk/tag-contains-ab' (early part) into HEAD

The initial "tag --contains" de-pessimization without need for generation
numbers is already in; backburnered.

* sr/transport-helper-fix-rfc (2011-07-19) 2 commits
 - t5800: point out that deleting branches does not work
 - t5800: document inability to push new branch with old content

* po/cygwin-backslash (2011-08-05) 2 commits
 - On Cygwin support both UNIX and DOS style path-names
 - git-compat-util: add generic find_last_dir_sep that respects is_dir_sep

I think a further refactoring (no, not my suggestion) was offered?

--------------------------------------------------
[Cooking]

* ac/describe-dirty-refresh (2011-08-11) 1 commit
 - describe: Refresh the index when run with --dirty

Will merge to "next", but needs Sign-off.

* en/merge-recursive-2 (2011-08-14) 57 commits
 - merge-recursive: Don't re-sort a list whose order we depend upon
 - merge-recursive: Fix virtual merge base for rename/rename(1to2)/add-dest
 - t6036: criss-cross + rename/rename(1to2)/add-dest + simple modify
 - merge-recursive: Avoid unnecessary file rewrites
 - t6022: Additional tests checking for unnecessary updates of files
 - merge-recursive: Fix spurious 'refusing to lose untracked file...' messages
 - t6022: Add testcase for spurious "refusing to lose untracked" messages
 - t3030: fix accidental success in symlink rename
 - merge-recursive: Fix working copy handling for rename/rename/add/add
 - merge-recursive: add handling for rename/rename/add-dest/add-dest
 - merge-recursive: Have conflict_rename_delete reuse modify/delete code
 - merge-recursive: Make modify/delete handling code reusable
 - merge-recursive: Consider modifications in rename/rename(2to1) conflicts
 - merge-recursive: Create function for merging with branchname:file markers
 - merge-recursive: Record more data needed for merging with dual renames
 - merge-recursive: Defer rename/rename(2to1) handling until process_entry
 - merge-recursive: Small cleanups for conflict_rename_rename_1to2
 - merge-recursive: Fix rename/rename(1to2) resolution for virtual merge base
 - merge-recursive: Introduce a merge_file convenience function
 - merge-recursive: Fix modify/delete resolution in the recursive case
 - merge-recursive: When we detect we can skip an update, actually skip it
 - merge-recursive: Provide more info in conflict markers with file renames
 - merge-recursive: Cleanup and consolidation of rename_conflict_info
 - merge-recursive: Consolidate process_entry() and process_df_entry()
 - merge-recursive: Improve handling of rename target vs. directory addition
 - merge-recursive: Add comments about handling rename/add-source cases
 - merge-recursive: Make dead code for rename/rename(2to1) conflicts undead
 - merge-recursive: Fix deletion of untracked file in rename/delete conflicts
 - merge-recursive: Split update_stages_and_entry; only update stages at end
 - merge-recursive: Allow make_room_for_path() to remove D/F entries
 - string-list: Add API to remove an item from an unsorted list
 - merge-recursive: Split was_tracked() out of would_lose_untracked()
 - merge-recursive: Save D/F conflict filenames instead of unlinking them
 - merge-recursive: Fix code checking for D/F conflicts still being present
 - merge-recursive: Fix sorting order and directory change assumptions
 - merge-recursive: Fix recursive case with D/F conflict via add/add conflict
 - merge-recursive: Avoid working directory changes during recursive case
 - merge-recursive: Remember to free generated unique path names
 - merge-recursive: Consolidate different update_stages functions
 - merge-recursive: Mark some diff_filespec struct arguments const
 - merge-recursive: Correct a comment
 - merge-recursive: Make BUG message more legible by adding a newline
 - t6022: Add testcase for merging a renamed file with a simple change
 - t6022: New tests checking for unnecessary updates of files
 - t6022: Remove unnecessary untracked files to make test cleaner
 - t6036: criss-cross + rename/rename(1to2)/add-source + modify/modify
 - t6036: criss-cross w/ rename/rename(1to2)/modify+rename/rename(2to1)/modify
 - t6036: tests for criss-cross merges with various directory/file conflicts
 - t6036: criss-cross with weird content can fool git into clean merge
 - t6036: Add differently resolved modify/delete conflict in criss-cross test
 - t6042: Add failing testcases for rename/rename/add-{source,dest} conflicts
 - t6042: Ensure rename/rename conflicts leave index and workdir in sane state
 - t6042: Add tests for content issues with modify/rename/directory conflicts
 - t6042: Add a testcase where undetected rename causes silent file deletion
 - t6042: Add a pair of cases where undetected renames cause issues
 - t6042: Add failing testcase for rename/modify/add-source conflict
 - t6042: Add a testcase where git deletes an untracked file

Rerolled.

* di/fast-import-ident (2011-08-11) 5 commits
 - fsck: improve committer/author check
 - fsck: add a few committer name tests
 - fast-import: check committer name more strictly
 - fast-import: don't fail on omitted committer name
 - fast-import: add input format tests

* fg/submodule-ff-check-before-push (2011-08-09) 1 commit
 - push: Don't push a repository with unpushed submodules

* hv/submodule-update-none (2011-08-11) 2 commits
 - add update 'none' flag to disable update of submodule by default
 - submodule: move update configuration variable further up

* jc/lookup-object-hash (2011-08-11) 6 commits
 - object hash: replace linear probing with 4-way cuckoo hashing
 - object hash: we know the table size is a power of two
 - object hash: next_size() helper for readability
 - pack-objects --count-only
 - object.c: remove duplicated code for object hashing
 - object.c: code movement for readability

* js/i18n-scripts (2011-08-08) 5 commits
 - submodule: take advantage of gettextln and eval_gettextln.
 - stash: take advantage of eval_gettextln
 - pull: take advantage of eval_gettextln
 - git-am: take advantage of gettextln and eval_gettextln.
 - gettext: add gettextln, eval_gettextln to encode common idiom

* cb/maint-ls-files-error-report (2011-08-11) 1 commit
  (merged to 'next' on 2011-08-15 at 69f41cf)
 + ls-files: fix pathspec display on error

* jc/maint-combined-diff-work-tree (2011-08-04) 1 commit
  (merged to 'next' on 2011-08-05 at 976a4d4)
 + diff -c/--cc: do not mistake "resolved as deletion" as "use working tree"

Will merge to "master" after cooking for a bit more.

* js/sh-style (2011-08-05) 2 commits
  (merged to 'next' on 2011-08-11 at 4a4c22c)
 + filter-branch.sh: de-dent usage string
 + misc-sh: fix up whitespace in some other .sh files.

* ma/am-exclude (2011-08-09) 2 commits
  (merged to 'next' on 2011-08-11 at cf0ba4d)
 + am: Document new --exclude=<path> option
  (merged to 'next' on 2011-08-05 at 658e57c)
 + am: pass exclude down to apply

Will merge to "master" after cooking for a bit more.

* db/am-skip-blank-at-the-beginning (2011-08-11) 1 commit
  (merged to 'next' on 2011-08-11 at 3637843)
 + am: ignore leading whitespace before patch

Will merge to "master" after cooking for a bit more.

* jc/maint-smart-http-race-upload-pack (2011-08-08) 1 commit
  (merged to 'next' on 2011-08-11 at 3f24b64)
 + helping smart-http/stateless-rpc fetch race

* jn/maint-test-return (2011-08-11) 3 commits
  (merged to 'next' on 2011-08-15 at 5a42301)
 + t3900: do not reference numbered arguments from the test script
 + test: cope better with use of return for errors
 + test: simplify return value of test_run_

* rt/zlib-smaller-window (2011-08-11) 2 commits
  (merged to 'next' on 2011-08-15 at e05b26b)
 + test: consolidate definition of $LF
 + Tolerate zlib deflation with window size < 32Kb

* fg/submodule-git-file-git-dir (2011-08-16) 3 commits
 - fixup! Move git-dir for submodules
 - Move git-dir for submodules
 - rev-parse: add option --resolve-git-dir <path>

* js/bisect-no-checkout (2011-08-09) 11 commits
  (merged to 'next' on 2011-08-11 at 6c94a45)
 + bisect: add support for bisecting bare repositories
 + bisect: further style nitpicks
 + bisect: replace "; then" with "\n<tab>*then"
 + bisect: cleanup whitespace errors in git-bisect.sh.
 + bisect: add documentation for --no-checkout option.
 + bisect: add tests for the --no-checkout option.
 + bisect: introduce --no-checkout support into porcelain.
 + bisect: introduce support for --no-checkout option.
 + bisect: add tests to document expected behaviour in presence of broken trees.
 + bisect: use && to connect statements that are deferred with eval.
 + bisect: move argument parsing before state modification.

* cb/maint-exec-error-report (2011-08-01) 2 commits
  (merged to 'next' on 2011-08-05 at 2764424)
 + notice error exit from pager
 + error_routine: use parent's stderr if exec fails

Will merge to "master" after cooking for a bit more.

* cb/maint-quiet-push (2011-08-08) 2 commits
  (merged to 'next' on 2011-08-08 at 917d73b)
 + receive-pack: do not overstep command line argument array
  (merged to 'next' on 2011-08-01 at 87df938)
 + propagate --quiet to send-pack/receive-pack

Will merge to "master" after cooking for a bit more.

* jk/add-i-hunk-filter (2011-07-27) 5 commits
  (merged to 'next' on 2011-08-11 at 8ff9a56)
 + add--interactive: add option to autosplit hunks
 + add--interactive: allow negatation of hunk filters
 + add--interactive: allow hunk filtering on command line
 + add--interactive: factor out regex error handling
 + add--interactive: refactor patch mode argument processing

* mh/check-attr-listing (2011-08-04) 23 commits
  (merged to 'next' on 2011-08-11 at f73ad50)
 + Rename git_checkattr() to git_check_attr()
 + git-check-attr: Fix command-line handling to match docs
 + git-check-attr: Drive two tests using the same raw data
 + git-check-attr: Add an --all option to show all attributes
 + git-check-attr: Error out if no pathnames are specified
 + git-check-attr: Process command-line args more systematically
 + git-check-attr: Handle each error separately
 + git-check-attr: Extract a function error_with_usage()
 + git-check-attr: Introduce a new variable
 + git-check-attr: Extract a function output_attr()
 + Allow querying all attributes on a file
 + Remove redundant check
 + Remove redundant call to bootstrap_attr_stack()
 + Extract a function collect_all_attrs()
 + Teach prepare_attr_stack() to figure out dirlen itself
 + git-check-attr: Use git_attr_name()
 + Provide access to the name attribute of git_attr
 + git-check-attr: Add tests of command-line parsing
 + git-check-attr: Add missing "&&"
 + Disallow the empty string as an attribute name
 + Remove anachronism from comment
 + doc: Correct git_attr() calls in example code
 + doc: Add a link from gitattributes(5) to git-check-attr(1)
 (this branch is used by mh/check-attr-relative.)

* mh/check-attr-relative (2011-08-04) 6 commits
  (merged to 'next' on 2011-08-11 at f94550c)
 + test-path-utils: Add subcommand "prefix_path"
 + test-path-utils: Add subcommand "absolute_path"
 + git-check-attr: Normalize paths
 + git-check-attr: Demonstrate problems with relative paths
 + git-check-attr: Demonstrate problems with unnormalized paths
 + git-check-attr: test that no output is written to stderr
 (this branch uses mh/check-attr-listing.)

* jk/http-auth-keyring (2011-08-03) 13 commits
  (merged to 'next' on 2011-08-03 at b06e80e)
 + credentials: add "getpass" helper
 + credentials: add "store" helper
 + credentials: add "cache" helper
 + docs: end-user documentation for the credential subsystem
 + http: use hostname in credential description
 + allow the user to configure credential helpers
 + look for credentials in config before prompting
 + http: use credential API to get passwords
 + introduce credentials API
 + http: retry authentication failures for all http requests
 + remote-curl: don't retry auth failures with dumb protocol
 + improve httpd auth tests
 + url: decode buffers that are not NUL-terminated

Looked mostly reasonable except for the limitation that it is not clear
how to deal with a site at which a user needs to use different passwords 
for different repositories.

* js/ref-namespaces (2011-07-21) 5 commits
  (merged to 'next' on 2011-07-25 at 5b7dcfe)
 + ref namespaces: tests
 + ref namespaces: documentation
 + ref namespaces: Support remote repositories via upload-pack and receive-pack
 + ref namespaces: infrastructure
 + Fix prefix handling in ref iteration functions

* rc/histogram-diff (2011-08-08) 12 commits
  (merged to 'next' on 2011-08-11 at 684dfd1)
 + xdiff/xhistogram: drop need for additional variable
 + xdiff/xhistogram: rely on xdl_trim_ends()
 + xdiff/xhistogram: rework handling of recursed results
 + xdiff: do away with xdl_mmfile_next()
  (merged to 'next' on 2011-08-03 at f9e2328)
 + Make test number unique
  (merged to 'next' on 2011-07-25 at 3351028)
 + xdiff/xprepare: use a smaller sample size for histogram diff
 + xdiff/xprepare: skip classification
 + teach --histogram to diff
 + t4033-diff-patience: factor out tests
 + xdiff/xpatience: factor out fall-back-diff function
 + xdiff/xprepare: refactor abort cleanups
 + xdiff/xprepare: use memset()

* rr/revert-cherry-pick-continue (2011-08-08) 18 commits
 - revert: Propagate errors upwards from do_pick_commit
 - revert: Introduce --continue to continue the operation
 - revert: Don't implicitly stomp pending sequencer operation
 - revert: Remove sequencer state when no commits are pending
 - reset: Make reset remove the sequencer state
 - revert: Introduce --reset to remove sequencer state
 - revert: Make pick_commits functionally act on a commit list
 - revert: Save command-line options for continuing operation
 - revert: Save data for continuing after conflict resolution
 - revert: Don't create invalid replay_opts in parse_args
 - revert: Separate cmdline parsing from functional code
 - revert: Introduce struct to keep command-line options
 - revert: Eliminate global "commit" variable
 - revert: Rename no_replay to record_origin
 - revert: Don't check lone argument in get_encoding
 - revert: Simplify and inline add_message_to_msg
 - config: Introduce functions to write non-standard file
 - advice: Introduce error_resolve_conflict

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox