* Re: [PATCH] tests: handle NO_PYTHON setting
From: Junio C Hamano @ 2009-11-30 8:28 UTC (permalink / raw)
To: Sverre Rabbelier
Cc: Jeff King, Johan Herland, Daniel Barkalow, Junio C Hamano, git
In-Reply-To: <fabb9a1e0911300004w36c5da45q354aa4ff3153b6f4@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
> On Mon, Nov 30, 2009 at 08:59, Jeff King <peff@peff.net> wrote:
>> I mean, I would think that the "git_remote_helpers" directory contained
>> remote helpers of all sorts, not just the python ones.
>
> I don't think that's true, git.git currently does not have such a
> structure (everything is just dumped in the root directory). The only
> reason git_remote_helpers exists is to make it easier to create a
> python egg out of it and install that.
If that is the case, shouldn't each of the helper written in Python need
to have a separate directory, not just a single git_remote_helpers
directory shared among them?
^ permalink raw reply
* Re: help reverting a merge
From: Justin P. Mattock @ 2009-11-30 8:31 UTC (permalink / raw)
To: Jeff King; +Cc: Christian Couder, git
In-Reply-To: <20091130081315.GA587@coredump.intra.peff.net>
On 11/30/09 00:13, Jeff King wrote:
> On Sun, Nov 29, 2009 at 03:24:09PM -0800, Justin Mattock wrote:
>
>> I've done a bisect on a problem with the kernel,
>> and am a bit confused on what to do. i.g. the
>> results are showing this:
>> a03fdb7612874834d6847107198712d18b5242c7 is the first bad commit
>>
>> [...]
>>
>> how do I find out the commits in this merge to automatically
>> revert to find the problem that's causing this bug?
>
> There is some discussion here:
>
> http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#bisect-merges
>
> Basically neither merged branch was buggy on its own, but together they
> have a bug. You can try rebasing the two sides of the merge into a
> linear history, and then bisecting on that:
>
> # order doesn't matter here, but rebasing 12e0933 on top makes more
> # sense since it has many fewer commits between it and the merge-base
> # (and you'll need to fix up conflicts manually, so the smaller the
> # rebase the better)
> git checkout 12e0933
> git rebase 202c467
>
> # to be safe, confirm that the rebase result shows your bug;
> # we know that 202c467 doesn't have the bug, or we would not have
> # bisected to the merge commit before
> test test test
> git bisect start
> git bisect bad HEAD
> git bisect good 202c467
>
> which should give you the specific commit on the side branch where the
> breakage occurred.
>
> This has been discussed as a technique before, and I have a feeling in
> the back of my mind that maybe there was talk of having git-bisect help
> with this case, but I don't think anything ever came of it. Christian
> (cc'd) would probably know more.
>
> -Peff
>
ahh cool..
I'll have a read on this in the
morning(late now)and see if I can do this
to find the bug.(keep in mind might take
some time i.g. not good at using git,
but am willing to learn a thing or two).
Justin P. Mattock
^ permalink raw reply
* Re: [PATCH] tests: handle NO_PYTHON setting
From: Sverre Rabbelier @ 2009-11-30 8:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Johan Herland, Daniel Barkalow, git
In-Reply-To: <7v4oocwh5o.fsf@alter.siamese.dyndns.org>
Heya,
On Mon, Nov 30, 2009 at 09:28, Junio C Hamano <gitster@pobox.com> wrote:
> Sverre Rabbelier <srabbelier@gmail.com> writes:
>> I don't think that's true, git.git currently does not have such a
>> structure (everything is just dumped in the root directory). The only
>> reason git_remote_helpers exists is to make it easier to create a
>> python egg out of it and install that.
>
> If that is the case, shouldn't each of the helper written in Python need
> to have a separate directory, not just a single git_remote_helpers
> directory shared among them?
I don't understand why that would be needed? The reason we added a
single git_remote_helpers directory is because we wanted to share
common code, having a single python package makes that easy.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [RFC/PATCH 2/2] builtin-merge: show user-friendly error messages for fast-forward too.
From: Matthieu Moy @ 2009-11-30 8:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy6lo7nu8.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> This is where I'm not 100% sure I'm not breaking some plumbing.
>
> I think this change is safe [...]
>
> Or did you have something a lot more subtle in mind?
Not at all. But since I found the place to add my code more or less
randomly with gdb, I feel safer with your comment ;-).
Thanks,
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: [PATCH] tests: handle NO_PYTHON setting
From: Junio C Hamano @ 2009-11-30 8:49 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: Jeff King, Johan Herland, Daniel Barkalow, git
In-Reply-To: <fabb9a1e0911300035o532153b7qdc2ecd768200ce09@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
> On Mon, Nov 30, 2009 at 09:28, Junio C Hamano <gitster@pobox.com> wrote:
>> Sverre Rabbelier <srabbelier@gmail.com> writes:
>>> I don't think that's true, git.git currently does not have such a
>>> structure (everything is just dumped in the root directory). The only
>>> reason git_remote_helpers exists is to make it easier to create a
>>> python egg out of it and install that.
>>
>> If that is the case, shouldn't each of the helper written in Python need
>> to have a separate directory, not just a single git_remote_helpers
>> directory shared among them?
>
> I don't understand why that would be needed? The reason we added a
> single git_remote_helpers directory is because we wanted to share
> common code, having a single python package makes that easy.
Sorry, I don't understand that. With that reasoning, isn't having a
single git package, be it python or not, even easier? Why would anybody
want a separate egg that includes everything that _happen_ to be written
in Python in the first place? It doesn't make sense at all from packaging
point of view to me.
A separate egg per remote-helper that you can pick and choose which ones
to install and which ones to leave out would make perfect sense, exactly
the same way that distros already split git into "git-core", "git-svn",
etc., though. Your "git-hg" may consist of a single egg and perhaps some
other supporting code, and people who want to convert away from legacy Hg
repository may want to install it, but it is entirely up to them if they
also want to install "git-cvs" that is implemented as a remote-helper that
happens to be written in Python, no?
^ permalink raw reply
* Re: [PATCH v3] Give the hunk comment its own color
From: Junio C Hamano @ 2009-11-30 9:00 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: Bert Wesarg, Jeff King, git
In-Reply-To: <fabb9a1e0911300009j1574c06cy500dde75fc68662f@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
> On Mon, Nov 30, 2009 at 08:47, Junio C Hamano <gitster@pobox.com> wrote:
>
>> I'll merge the updated (i.e. rewound and then rebuilt) tip
>> of the topic branch when the topic graduates to the master (hopefully
>> before 1.6.6-rc1), so we won't see the botched one in the end result.
>
> I'm curious how you do this. Do you keep a list of replacements, that
> is "when merging branch foo from next to master, instead merge bar",
> or is it something the original author should remind you of when it's
> time to merge to master?
If you run "git log --oneline --first-parent master..pu", you will notice
that there is no "Merge ... into next" at all.
I maintain a private 'jch' branch that merges everything that has been
merged so far to 'next' and the branch always builds on top of 'master'
whenever 'pu' is pushed out. The tree object recorded by the tip of 'jch'
is designed to always match that of 'next'. And 'pu' is built on top of
'jch', instead of 'next', these days.
The Reintegrate script fron 'todo' (recall that I have a checkout of the
branch in "Meta/" directory) is used this way:
... update 'jch' by merging topics that had new commits
$ git checkout jch && git merge xx/topic && ...
... update the list of topics
$ Meta/Reintegrate master..jch >/var/tmp/redo-jch.sh
... update 'master' with commits and merges
$ git checkout master
$ git am trivially-correct-patch.mbox
$ git merge yy/topic
... update 'next'
$ git checkout next
$ git merge master
... will merge new topics and topics that had new commits
$ sh /var/tmp/redo-jch.sh
... rebuild 'jch' on top of the updated master
$ git checkout jch
$ git reset --hard master
$ sh /var/tmp/redo-jch.sh
... then this shouldn't produce any output
$ git diff next
This time, what I did _after_ Bert noticed my typo was:
$ git checkout bw/diff-color-hunk-header
$ edit diff.c ;# fix my typo
$ git commit --amend -a
$ git diff HEAD@{1} >P.diff
$ git checkout next
$ git apply --index P.diff
$ git commit -m 'typofix'
After this, while rebuilding 'jch' branch the next time, Reintegrate
script will notice that the bw/diff-color-hunk-header topic has been
rebased. I can simply edit that note out in the /var/tmp/redo-jch.sh
script and rebuild 'jch' branch---the result will exactly match 'next'.
The end result is that the commit merged in 'next' is not the tip of
bw/diff-color-hunk-header anymore, but merging the _current_ tip of that
branch together with all the other topics on top of 'master' would produce
the desired result without "oops---that was a stupid typo" fixups.
^ permalink raw reply
* Re: [PATCH v3] Give the hunk comment its own color
From: Sverre Rabbelier @ 2009-11-30 9:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Bert Wesarg, Jeff King, git
In-Reply-To: <7vvdgstmic.fsf@alter.siamese.dyndns.org>
Heya,
On Mon, Nov 30, 2009 at 10:00, Junio C Hamano <gitster@pobox.com> wrote:
> I maintain a private 'jch' branch that merges everything that has been
> merged so far to 'next' and the branch always builds on top of 'master'
> whenever 'pu' is pushed out. The tree object recorded by the tip of 'jch'
> is designed to always match that of 'next'. And 'pu' is built on top of
> 'jch', instead of 'next', these days.
Ah, so _that''s_ how you pull of not rebasing and still maintaining a
clean history in master: keeping a private shadow branch with the
cleaned up history that is tree-identical to the no-rebase next
branch. Interesting.
> The end result is that the commit merged in 'next' is not the tip of
> bw/diff-color-hunk-header anymore, but merging the _current_ tip of that
> branch together with all the other topics on top of 'master' would produce
> the desired result without "oops---that was a stupid typo" fixups.
Thanks for explaining, git really does allow for a lot of interesting
workflows :).
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [LIBGIT2 PATCH] git_odb_open ckeck for valid path to database
From: Esben Mose Hansen @ 2009-11-30 9:37 UTC (permalink / raw)
To: Ramsay Jones; +Cc: ae, git
In-Reply-To: <200911102207.04135.kde@mosehansen.dk>
On Tuesday 10 November 2009 22:07:04 Esben Mose Hansen wrote:
> On Monday 09 November 2009 20:16:15 Ramsay Jones wrote:
>
> I have made 2 new patchsets: One
Did these get lost in transit? Or am I going about it in the wrong way? :)
Thank you for your time
--
Kind regards, Esben
^ permalink raw reply
* Re: [PATCH] tests: handle NO_PYTHON setting
From: Sverre Rabbelier @ 2009-11-30 9:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Johan Herland, Daniel Barkalow, git
In-Reply-To: <7vr5rgv1lr.fsf@alter.siamese.dyndns.org>
Heya,
On Mon, Nov 30, 2009 at 09:49, Junio C Hamano <gitster@pobox.com> wrote:
> Sorry, I don't understand that. With that reasoning, isn't having a
> single git package, be it python or not, even easier? Why would anybody
> want a separate egg that includes everything that _happen_ to be written
> in Python in the first place? It doesn't make sense at all from packaging
> point of view to me.
Because that's the recommended way to create a python package, create
a new directory, put the files in it, and distribute it.
> A separate egg per remote-helper that you can pick and choose which ones
> to install and which ones to leave out would make perfect sense, exactly
> the same way that distros already split git into "git-core", "git-svn",
> etc., though. Your "git-hg" may consist of a single egg and perhaps some
> other supporting code, and people who want to convert away from legacy Hg
> repository may want to install it, but it is entirely up to them if they
> also want to install "git-cvs" that is implemented as a remote-helper that
> happens to be written in Python, no?
Yes, fair enough, but we don't do that for any other files in git.git.
The packagers do so, sure, but a different concern. The reason we want
to distribute the git_remote_helpers package is so that
git-remote-hg.py, which lives in git.git/ and is installed as
git-remote-hg can say "from git_remote_helpers.hg import export".
The only reason this is needed in the first place is because we can't
just add the python files to libgit.a or embed it in git-remote-hg
statically, python does not support that. That is the only reason we
need to distribute the package, which is why we need a separate
directory.
That is, if I've understood Johan's reasoning and intention correctly.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [PATCH] reset: add --quiet option
From: Felipe Contreras @ 2009-11-30 10:19 UTC (permalink / raw)
To: Stephen Boyd; +Cc: git
In-Reply-To: <1259543939.5679.5.camel@swboyd-laptop>
On Mon, Nov 30, 2009 at 3:18 AM, Stephen Boyd <bebarino@gmail.com> wrote:
> Why not just OPT__QUIET? We lose the specific help string but it's
> possible that what quiet is silencing will change in the future.
I thought somebody would complain about loosing that string. In any
case, first step is adding --query to 'git reset', second step is
moving all OPT_BOOLEAN('q' to OPT__QUIET; there are other commands
doing the same.
--
Felipe Contreras
^ permalink raw reply
* Re: [PATCH] tests: handle NO_PYTHON setting
From: Johan Herland @ 2009-11-30 10:59 UTC (permalink / raw)
To: git; +Cc: Sverre Rabbelier, Junio C Hamano, Jeff King, Daniel Barkalow
In-Reply-To: <fabb9a1e0911300156l7f8dbe55p7da26540b0360773@mail.gmail.com>
On Monday 30 November 2009, Sverre Rabbelier wrote:
> Heya,
>
> On Mon, Nov 30, 2009 at 09:49, Junio C Hamano <gitster@pobox.com> wrote:
> > Sorry, I don't understand that. With that reasoning, isn't having a
> > single git package, be it python or not, even easier? Why would
> > anybody want a separate egg that includes everything that _happen_ to
> > be written in Python in the first place? It doesn't make sense at all
> > from packaging point of view to me.
>
> Because that's the recommended way to create a python package, create
> a new directory, put the files in it, and distribute it.
>
> > A separate egg per remote-helper that you can pick and choose which
> > ones to install and which ones to leave out would make perfect sense,
> > exactly the same way that distros already split git into "git-core",
> > "git-svn", etc., though. Your "git-hg" may consist of a single egg and
> > perhaps some other supporting code, and people who want to convert away
> > from legacy Hg repository may want to install it, but it is entirely up
> > to them if they also want to install "git-cvs" that is implemented as a
> > remote-helper that happens to be written in Python, no?
>
> Yes, fair enough, but we don't do that for any other files in git.git.
> The packagers do so, sure, but a different concern. The reason we want
> to distribute the git_remote_helpers package is so that
> git-remote-hg.py, which lives in git.git/ and is installed as
> git-remote-hg can say "from git_remote_helpers.hg import export".
>
> The only reason this is needed in the first place is because we can't
> just add the python files to libgit.a or embed it in git-remote-hg
> statically, python does not support that. That is the only reason we
> need to distribute the package, which is why we need a separate
> directory.
>
> That is, if I've understood Johan's reasoning and intention correctly.
Yes, you have. I'll repeat the history of this to hopefully clarify:
I first created a "git-remote-cvs.py" script (originally under a different
name, but that is not important), that was transformed (essentially copied)
to "git-remote-cvs" by the build process. This script was large and
unwieldy, however, and I found it more maintainable to split it into several
python scripts. So I created a "git_remote_cvs", and put the supporting
scripts in there.
Now, in order for the smaller "git-remote-cvs" executable to do its job, it
needed to import the supporting scripts at runtime, so I decided to make a
python egg from the "git_remote_cvs" subdir, that would be installed using
Python's infrastructure. This, I deemed, was the safest way to ensure that
the "git_remote_cvs" scripts were always available at runtime.
Next, Sverre started his "git-remote-hg.py" script, and found that he could
re-use some of the scripts in the "git_remote_cvs" package. He therefore
(with my blessing) refactored this subdir into the "git_remote_helpers"
subdir/package that is currently under discussion. Hence, this subdir is
meant to contain the support scripts for remote helper written in Python,
both common support scripts, and support scripts specific to each remote
helper. So far, only the common code is there, but we expect the Hg and CVS
helpers to add scripts to the "hg" and "cvs" subsubdirs, respectively.
END_OF_HISTORY
Just to clarify, Git remote helpers does not live in the
"git_remote_helpers" subdir. The subdir (which is installed as a Python
library package) does not contain anything resembling a complete remote
helper. Instead, the remote helper scripts live as regular scripts in the
git.git root dir, and (like any other git program) are turned into
executables by the build process. The difference is that two of the remote
helpers currently being developed (Sverre's "git-remote-hg", and my "git-
remote-cvs") are written in Python, and (want to) share some common
supporting code currently located in the "git_remote_helpers" subdir.
We _could_ split up the "git_remote_helpers" package into a "git-remote-hg"-
specific package, and a "git-remote-cvs"-specific package, but that would
mean either having two copies of the current support code. Alternately, we
could create a _third_ package containing the common support code, that each
of our hg/cvs support packages would in turn depend on. I don't think we
want to go there, at least not yet.
Also, to prevent this misunderstanding, we could create a "python" subdir in
git.git, and move the "git_remote_helpers" into there. However, it would
slightly complicate (at least) the git-remote-cvs.py script which currently
exploits the "coincidence" that the subdir has the same name as the
corresponding python package, and is therefore testable in both its unbuilt
and built state.
Hope this helps,
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply
* Re: git am and CRLF files
From: Daniele Segato @ 2009-11-30 12:06 UTC (permalink / raw)
To: kusmabite; +Cc: Nanako Shiraishi, Stefan Naewe, git@vger.kernel.org
In-Reply-To: <40aa078e0911160343k41393197s56d26576bcbfbe90@mail.gmail.com>
On Mon, Nov 16, 2009 at 12:43 PM, Erik Faye-Lund
<kusmabite@googlemail.com> wrote:
> According to RFC 5322, email messages use CRLF as the
> newline-sequence. In order to be able to distinguish between CRLF and
> LF in an e-mail patch, the message needs to be use some
> transfer-encoding that preserves newline style (like base64).
>
> Perhaps this would be better fixed by having format-patch (or prehaps
> the MUA ?) base64-encode the message body if the file contains
> non-LF-newlines, and normalizing CRLF to LF before transport-decoding?
> Or does some MUAs transport-decode before storing the message to disk?
>
> I realize this might make it a bit tricky to review patches that
> contains CRLF-newlines before mailing them out, but perhaps inspecting
> the format-patch output is the wrong place to do this?
why don't adding that information in the mail header?
or may be made format-patch create a "comment line" with that information?
if that line is missing it could keep the default behavior (what it
did until now)
^ permalink raw reply
* git archive without path
From: Dmitry Potapov @ 2009-11-30 12:32 UTC (permalink / raw)
To: git
Hi!
I have never run "git archive" inside of a subdirectory but somehow I
have always assumed that it creates an archive containing all files in
it regardless the current directory. In fact, the git-archive man page
says so:
path
If one or more paths are specified, include only these in the
archive, otherwise include all files and subdirectories.
But it turned out that "git archive" works as "git archive .", i.e.
adds files starting with the current directory. Is any rational for
this behavior? It smells to me like a bug rather than a feature. I
cannot imagine wanting to create archive containing just part of the
whole repository just because he happened to be in that directory,
and documentation clearly says that all files should be added unless
one or more paths are specified.
Dmitry
^ permalink raw reply
* Re: [RFC/PATCH] t7011: Mark fixed test as such
From: Michael J Gruber @ 2009-11-30 12:49 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: git, Junio C Hamano
In-Reply-To: <fcaeb9bf0911291756g1857fe32r8da8e50f0a137119@mail.gmail.com>
Nguyen Thai Ngoc Duy venit, vidit, dixit 30.11.2009 02:56:
> On Sun, Nov 29, 2009 at 8:57 PM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> Nguyen Thai Ngoc Duy venit, vidit, dixit 29.11.2009 09:47:
>>> On 11/29/09, Michael J Gruber <git@drmicha.warpmail.net> wrote:
>>>> Test 16/17 had been fixed since its introduction in b4d1690 (Teach Git
>>>> to respect skip-worktree bit (reading part), 2009-08-20). So, mark it as
>>>> expect_success rather than expect_failure.
>>>>
>>>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
>>>
>>> No ACK. See below.
>>>
>>>> ---
>>>> I'm actually wondering about 17/17 as well.
>>>> If commit is called with a file name then shouldn't it simply commit the
>>>> current state of the file in the worktree, no matter what the index or
>>>> skip-worktree say? I therefore think 17/17 should be expect_success
>>>> and have no test_must_fail.
>>>
>>> Both 16/17 and 17/17 ensure that Git won't look at files on worktree
>>> if they are marked as skip-worktree (by definition of skip-worktree,
>>> you can safely ignore worktree, otherwise you would not mark them as
>>> such). 16/17 happens to pass, not because it does not touch worktree,
>>> but because the base index does not have "1", which happens to is the
>>> same situation in 16/17 (test commit when "1" is gone). The result is
>>> OK but it is actually not (17/17 shows this clearer as it commits the
>>> worktree version).
>>
>> On 16/17, I really cannot agree. You explain that you expect the test to
>> succeed (we agree here), but that it succeeds for the wrong reasons. So
>> it should be either "expect_success", or the test itself should be
>> changed so that it really tests what it intends to, otherwise it raises
>> a wrong "FIXED". I suggested and submitted the former.
>
> That was my bad in setting up the environment for 16/17. I will fix
> that in the next roll of nd/sparse.
>
>> On 17/17, it's not clear what should happen. "skip-worktree" says ignore
>> the worktree and look in the index instead of accessing worktree files.
>> But "git commit file" says ignore the index and stage and commit the
>> file from the worktree directly. And that is exactly what happens:
>>
>> You say "git commit file".
>> That means "ignore the index".
>> That also means that git ignores the skip-worktree bit which is set in
>> the index.
>> Therefore, file is committed with the content is has in the worktree.
>
> To me, no command should break out skip-worktree mask. In reality I
> would expect that case 17/17 only happens when a user accidentally
> leaves a file that is marked skip-worktree and tries to commit it. An
> error would be more appropriate to keep consistency with other
> commands ("git diff HEAD -- 1" would show nothing before committing),
> and to warn the user that he/she is stepping on the border. He/she can
> then choose to extend worktree area if still wants to commit that
> file. How does that sound?
>
>> I'm going by the documentation for git-update-index and git-commit. It
>> could be that they are wrong, too, but they agree with the code, so
>> what's the reference for saying both code and documentation are wrong?
>
> Both code and documentation are for Git without skip-worktree. If you
> agree with my reasoning above, I will update documentation to reflect
> this too.
Thanks for the clarification. I see the background behind 17/17 now. I
think git-commit.txt needs a careful update then, because the
explanation of a common feature (git commit file) should not get
confusing because of a not so common feature (skip-worktree/sparse co).
Regarding 16/17: Seeing a FIXED is very misleading. I caught it during
my work on a patch series and was confused. FIXED usually occurs only
while working on a fix, before adjusting the test. So, unless the reroll
of nd/sparse is to happen very soon, I still suggest marking it as
expect_success as proposed, and then modifying the test during the reroll.
Cheers,
Michael
^ permalink raw reply
* Re: git am and CRLF files
From: Ismael Luceno @ 2009-11-30 12:50 UTC (permalink / raw)
To: Daniele Segato; +Cc: git
In-Reply-To: <9accb4400911300406l592306c8t889c28ba7b48674b@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]
Daniele Segato escribió:
> On Mon, Nov 16, 2009 at 12:43 PM, Erik Faye-Lund
> <kusmabite@googlemail.com> wrote:
>> According to RFC 5322, email messages use CRLF as the
>> newline-sequence. In order to be able to distinguish between CRLF and
>> LF in an e-mail patch, the message needs to be use some
>> transfer-encoding that preserves newline style (like base64).
>>
>> Perhaps this would be better fixed by having format-patch (or prehaps
>> the MUA ?) base64-encode the message body if the file contains
>> non-LF-newlines, and normalizing CRLF to LF before transport-decoding?
>> Or does some MUAs transport-decode before storing the message to disk?
>>
>> I realize this might make it a bit tricky to review patches that
>> contains CRLF-newlines before mailing them out, but perhaps inspecting
>> the format-patch output is the wrong place to do this?
>
>
> why don't adding that information in the mail header?
> or may be made format-patch create a "comment line" with that information?
>
> if that line is missing it could keep the default behavior (what it
> did until now)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
It would make more sense to simply use MIME attachments...
--
Ismael Luceno
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: git archive without path
From: Michael J Gruber @ 2009-11-30 13:05 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: git
In-Reply-To: <20091130123203.GA11235@dpotapov.dyndns.org>
Dmitry Potapov venit, vidit, dixit 30.11.2009 13:32:
> Hi!
>
> I have never run "git archive" inside of a subdirectory but somehow I
> have always assumed that it creates an archive containing all files in
> it regardless the current directory. In fact, the git-archive man page
> says so:
>
> path
> If one or more paths are specified, include only these in the
> archive, otherwise include all files and subdirectories.
>
>
> But it turned out that "git archive" works as "git archive .", i.e.
> adds files starting with the current directory. Is any rational for
> this behavior? It smells to me like a bug rather than a feature. I
> cannot imagine wanting to create archive containing just part of the
> whole repository just because he happened to be in that directory,
> and documentation clearly says that all files should be added unless
> one or more paths are specified.
Depends on the definition of "all" :)
In fact: Two mighty powers are fighting right now for the primacy in the
Land of the Git, and both carry the name "consistency" on their flags.
One is the "order of the consistency of generations", also named
"backwards compatibility", and one is the "order of the consistency of
commands", also named "user experience".
Many commands have different defaults with respect to how they behave in
a subdirectory (compare status to ls-files, e.g.), and the discussion
about how to best change that are underway, most prominently in the case
of git grep. I expect that we'll have a gradual migration path towards a
"full-tree" default, but that is just my personal interpretation of the
current "battle". In the short term the best that we can hope for is a
consistent, convenient notation which enforcers a specific behaviour,
such as "/" (non-existent) versus "." (existent).
Cheers,
Michael
^ permalink raw reply
* [PATCH] Add --track option to git clone
From: David Soria Parra @ 2009-11-30 13:16 UTC (permalink / raw)
To: git
The following series adds a --track option to git clone. If the --track option
is specified only the given remote branch will be received and checked out.
It tries to make the following usecase possible:
Imagine you are working on a project that has 1.x and a 2.x branch. The project
itself requires a complex setup (webserver, configuration files, etc). Setting up
1.x and 2.x branch requires a lot of work, but a developer needs to maintain both.
He'll use the --track option to clone the 2.x branch into a directory and does the same
with the 1.x branch, where he setup the project. He can use locally separate repositories
while still being able to push to just one remote repository.
I'm aware that it's not possible to give more than one --track option. Implementing
the possibility to specify multiple --track option would certainly a good improvment
later, but would also require a lot more work as far as I understand the clone code.
Being able to specify just one --track option is a compromise of doing a small change
and implementing this feature.
^ permalink raw reply
* [PATCH 1/2] Teach clone to clone just one remote branch using --track
From: David Soria Parra @ 2009-11-30 13:16 UTC (permalink / raw)
To: git; +Cc: David Soria Parra
In-Reply-To: <1259587004-14633-1-git-send-email-sn_@gmx.net>
From: David Soria Parra <dsp@php.net>
Add a --track option that can be used to clone just the
given branch from the remote and nothing else. This is done
by setting the remote.<branch>.fetch option before cloning.
This option cannot be used together with --mirror.
For example using
git clone --track next git://git.kernel.org/pub/scm/git/git.git
will just clone the next branch from the git.git repository.
The option is called --track to ensure clean wording with
'git remote add --track'.
Signed-off-by: David Soria Parra <dsp@php.net>
---
builtin-clone.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/builtin-clone.c b/builtin-clone.c
index 5df8b0f..bc335ee 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -43,6 +43,7 @@ static char *option_template, *option_reference, *option_depth;
static char *option_origin = NULL;
static char *option_branch = NULL;
static char *option_upload_pack = "git-upload-pack";
+static char *option_track = NULL;
static int option_verbose;
static struct option builtin_clone_options[] = {
@@ -76,6 +77,8 @@ static struct option builtin_clone_options[] = {
"path to git-upload-pack on the remote"),
OPT_STRING(0, "depth", &option_depth, "depth",
"create a shallow clone of that depth"),
+ OPT_STRING('t', "track", &option_track, "branch",
+ "remote branche to track"),
OPT_END()
};
@@ -483,7 +486,14 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
strbuf_addf(&branch_top, "refs/remotes/%s/", option_origin);
}
- strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top.buf);
+ if (option_track) {
+ if (option_mirror)
+ return error("Cannot use --track together with --mirror");
+ strbuf_addf(&value, "+%s%s:%s%s", src_ref_prefix, option_track, branch_top.buf, option_track);
+ option_branch = option_track;
+ } else {
+ strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top.buf);
+ }
if (option_mirror || !option_bare) {
/* Configure the remote */
--
1.6.6.rc0.268.g1c272
^ permalink raw reply related
* [PATCH 2/2] Documentation: Add --track option to the git clone manpage
From: David Soria Parra @ 2009-11-30 13:16 UTC (permalink / raw)
To: git; +Cc: David Soria Parra
In-Reply-To: <1259587004-14633-1-git-send-email-sn_@gmx.net>
From: David Soria Parra <dsp@php.net>
Signed-off-by: David Soria Parra <dsp@php.net>
---
Documentation/git-clone.txt | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 7e7d9fc..3c2e1b8 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -12,7 +12,7 @@ SYNOPSIS
'git clone' [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-u <upload-pack>] [--reference <repository>]
- [--depth <depth>] [--recursive] [--] <repository> [<directory>]
+ [-t <name>] [--depth <depth>] [--recursive] [--] <repository> [<directory>]
DESCRIPTION
-----------
@@ -135,6 +135,12 @@ objects from the source repository into a pack in the cloned repository.
instead. In a non-bare repository, this is the branch that will
be checked out.
+--track <name>::
+-t <name>::
+ Instead of cloning the complete remote repository, only the given
+ remote branch `<name>` will be tracked and checked out.
+ This implies --branch `<name>`.
+
--upload-pack <upload-pack>::
-u <upload-pack>::
When given, and the repository to clone from is accessed
--
1.6.6.rc0.268.g1c272
^ permalink raw reply related
* Re: [RFC/PATCH] t7011: Mark fixed test as such
From: Nguyen Thai Ngoc Duy @ 2009-11-30 13:18 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git, Junio C Hamano
In-Reply-To: <4B13BF3D.7010503@drmicha.warpmail.net>
On 11/30/09, Michael J Gruber <git@drmicha.warpmail.net> wrote:
> Regarding 16/17: Seeing a FIXED is very misleading. I caught it during
> my work on a patch series and was confused. FIXED usually occurs only
> while working on a fix, before adjusting the test. So, unless the reroll
> of nd/sparse is to happen very soon, I still suggest marking it as
> expect_success as proposed, and then modifying the test during the reroll.
I won't work on it until this weekend. If you insist, then better put
command "true" after test_must_fail to indicate that the test is
broken (could be line-wrapped by gmail, but it's simple enough to
recreate)
diff --git a/t/t7011-skip-worktree-reading.sh b/t/t7011-skip-worktree-reading.sh
index e996928..da8dcbb 100755
--- a/t/t7011-skip-worktree-reading.sh
+++ b/t/t7011-skip-worktree-reading.sh
@@ -152,6 +152,7 @@ test_expect_failure 'commit on skip-worktree
absent entries' '
git reset &&
setup_absent &&
test_must_fail git commit -m null 1
+ true
'
test_expect_failure 'commit on skip-worktree dirty entries' '
--
Duy
^ permalink raw reply related
* [PATCH] Documentation: Document --branch option in git clone synopsis
From: David Soria Parra @ 2009-11-30 13:27 UTC (permalink / raw)
To: git; +Cc: David Soria Parra
From: David Soria Parra <dsp@php.net>
Document the --branch option as [-b <name>] in git clones synopsis.
Signed-off-by: David Soria Parra <dsp@php.net>
---
Documentation/git-clone.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 7e7d9fc..7ccd742 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git clone' [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
- [-o <name>] [-u <upload-pack>] [--reference <repository>]
+ [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
[--depth <depth>] [--recursive] [--] <repository> [<directory>]
DESCRIPTION
--
1.6.6.rc0.268.g1c272
^ permalink raw reply related
* Re: [PATCH] Add --track option to git clone
From: Michael J Gruber @ 2009-11-30 13:36 UTC (permalink / raw)
To: David Soria Parra; +Cc: git
In-Reply-To: <1259587004-14633-1-git-send-email-sn_@gmx.net>
David Soria Parra venit, vidit, dixit 30.11.2009 14:16:
> The following series adds a --track option to git clone. If the --track option
> is specified only the given remote branch will be received and checked out.
>
> It tries to make the following usecase possible:
> Imagine you are working on a project that has 1.x and a 2.x branch. The project
> itself requires a complex setup (webserver, configuration files, etc). Setting up
> 1.x and 2.x branch requires a lot of work, but a developer needs to maintain both.
> He'll use the --track option to clone the 2.x branch into a directory and does the same
> with the 1.x branch, where he setup the project. He can use locally separate repositories
> while still being able to push to just one remote repository.
While I think the feature itself is useful, I don't think it's that
useful for the case you mention. If you clone all branches anyways
you're much better of using alternates or --reference, or the workdir
script in contrib/
> I'm aware that it's not possible to give more than one --track option. Implementing
> the possibility to specify multiple --track option would certainly a good improvment
> later, but would also require a lot more work as far as I understand the clone code.
>
> Being able to specify just one --track option is a compromise of doing a small change
> and implementing this feature.
That restriction makes a lot of sense. Two suggestions:
- How does one turn such a "partial" clone into a full one? That should
be documented somewhere (git config remote.origin.fetch
'+refs/heads/*:refs/remotes/origin/*').
- A test would be nice, which makes sure you clone what you think you clone.
Cheers,
Michael
^ permalink raw reply
* equal-tree-merges as way to make rebases fast-forward-able
From: Bernhard R. Link @ 2009-11-30 14:43 UTC (permalink / raw)
To: git
The itch this idea is supposed to scratch is the problem that a rebase
or a amended commit is no longer a fast-forward, so cannot be easily
pulled.
While this is not a problem in most workflows, as one can either merge
or keep everything private and rebase until published, it would be nice
to have a way for cases in between, where both a clean presentable
commit order is to be maintained and people (or yourself from different
repositories) should be able to easily upgrade to newer versions without
an error-prone not-fast-forward.
My idea to solve this is combining both histories, the rebased/revised
history and the actualy history, marking with some "equal-tree-merge"
the point where they have the same result.
The following mails show some patches to implement this by means of
a merge where all parents have the same tree and some special casing
when encountering such a thing. This has the advantage that older git
version will just see strange merges and may present both histories,
but otherwise just work.
Example 1:
Let's assume you maintain such a regularily-rebased branch that you
want to be able to publish (or pull from other repositories for example
on your laptop):
o=m=o=o=master
\
a=b=c=d=e=feature
with this patch you can do "git rebase -eqt master" and get:
a'=b'=c'=d'=e'=feature'=eqt
/ /
o=m=o=o=master-------- /
\ \ /
a=b=c=d=e=feature--merge-------
i.e: the new feature branch has both histories:
- "feature'" where everything is cleanly rebased and in a form where
format-patch is suitable to send it upstream
- "merge" which is both a descendant from feature (so one can see what
changed since that time and can just pull when one had had cloned feature)
Example 2:
Let's assume you have a feature branch like
o=master
\
a=b=c=d=e=f
Assume you just commited "f" which fixes a bug introduced by "b".
Now you of course do not want to send it that way upstream (as it will
make reviewing harder, may force people bisecting to skip some versions
every time they hit this region and so on), so you want to
bisect -i and squash "f" into "b".
o=master
\
a=b+f=c'=d'=e'
But if you had already cloned at state "d" to your laptop (or made a backup
of that branch at some server, or published it for use of some collegues)
it will not be a fast-forward, so you have to be very carefull to not
accidentially lose a commit that is already there.
So with this patches you can do "git rebase -i --eqt" and squash f into b
and get:
o=master
\
a=b=c=d=e=f---
\ \
b+f=c'=d'=e'=eqt
which means that you can just pull from your laptop and get the new head
as fast-forward, but still have a proper history ready for submitting.
The only downsize of this approach is that an unpatched/old git of course
does not know about that it can just choose one of both histories but think
it has to look at both, so git-format-patch will return patches multiple times
and git-rebase will also try to apply both branches, which the patched version
no longer does, only showing the 'presentable' in this case.
Those patches are a bit rough and mostly intended to show how it could work
and to allow experimenting with it. I think the biggest thing still missing
(apart from documentation, error handling, better commit messages) is making
git bisect take advantage of this and only looking at the nice branch.
Bernhard R. Link (7):
add new command git equal-tree-marker
add option to only visit the first parent of a equal tree merge
format-patch defaults to --first-equal-tree-only
support equal tree merges in interactive rebase
make rebase -m equal tree marker aware
add support for creating equal tree markers after rebase
add support for creating equal tree markers to rebase -i
.gitignore | 1 +
Makefile | 1 +
builtin-log.c | 1 +
git-equal-tree-marker.sh | 50 ++++++++++++++++++++++++++++++++++++++
git-rebase--interactive.sh | 33 +++++++++++++++++++++++++
git-rebase.sh | 35 ++++++++++++++++++++++++--
revision.c | 57 +++++++++++++++++++++++++++++++++++++-------
revision.h | 1 +
8 files changed, 167 insertions(+), 12 deletions(-)
create mode 100644 git-equal-tree-marker.sh
Hochachtungsvoll,
Bernhard R. Link
--
"Never contain programs so few bugs, as when no debugging tools are available!"
Niklaus Wirth
^ permalink raw reply
* [PATCH 1/7] add new command git equal-tree-marker
From: Bernhard R. Link @ 2009-11-30 14:43 UTC (permalink / raw)
To: git
In-Reply-To: <cover.1259524136.git.brlink@debian.org>
This adds a new commit denoting tha current branch has the same
tree as another branch, thus allowing fast-forward from the named
commits to this one.
TODO: manpage, rewrite as builtin once the semantics are accepted?
---
.gitignore | 1 +
Makefile | 1 +
git-equal-tree-marker.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 git-equal-tree-marker.sh
diff --git a/.gitignore b/.gitignore
index ac02a58..248d146 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,6 +39,7 @@
/git-difftool
/git-difftool--helper
/git-describe
+/git-equal-tree-marker
/git-fast-export
/git-fast-import
/git-fetch
diff --git a/Makefile b/Makefile
index 4dba10e..913d4c4 100644
--- a/Makefile
+++ b/Makefile
@@ -336,6 +336,7 @@ TEST_PROGRAMS =
SCRIPT_SH += git-am.sh
SCRIPT_SH += git-bisect.sh
SCRIPT_SH += git-difftool--helper.sh
+SCRIPT_SH += git-equal-tree-marker.sh
SCRIPT_SH += git-filter-branch.sh
SCRIPT_SH += git-lost-found.sh
SCRIPT_SH += git-merge-octopus.sh
diff --git a/git-equal-tree-marker.sh b/git-equal-tree-marker.sh
new file mode 100644
index 0000000..403cc56
--- /dev/null
+++ b/git-equal-tree-marker.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Bernhard R. Link
+#
+# Create a new commit making HEAD parent of the arguments,
+# which must be commits with the same tree.
+
+set -e
+
+USAGE='<head>...'
+LONG_USAGE='Make current HEAD parent of the given heads (which need to have the same tree).'
+SUBDIRECTORY_OK=Yes
+OPTIONS_SPEC=
+. git-sh-setup
+cd_to_toplevel
+
+# is there really no function for this?
+tree_of_commit() {
+ git cat-file commit "$1" | grep '^tree ' | head -n 1 | sed -e 's/^tree //'
+}
+
+head="$(git rev-parse --verify HEAD)"
+htree="$(tree_of_commit $head)"
+parents=""
+while test $# -gt 0
+do
+ case "$1" in
+ -h|--h|--he|--hel|--help)
+ usage
+ ;;
+ *)
+ h="$(git rev-parse --verify $1)"
+ tree="$(tree_of_commit "$h")"
+ if test "x${htree}" != "x${tree}" ; then
+ echo "Tree of $h is not the same as tree of $head" >&2
+ exit 1
+ fi
+ parents="$parents -p $h"
+ ;;
+ esac
+ shift
+done
+
+if test "x$parents" = "x" ; then
+ echo "Not enough arguments!" >&2
+ exit 1
+fi
+
+new_commit="$(echo "Equal tree marker" | git commit-tree "$tree" -p "$head" $parents)"
+git-update-ref HEAD "$new_commit"
--
1.6.6.rc0.82.g60a15.dirty
^ permalink raw reply related
* [PATCH 2/7] add option to only visit the first parent of a equal tree merge
From: Bernhard R. Link @ 2009-11-30 14:44 UTC (permalink / raw)
To: git
In-Reply-To: <cover.1259524136.git.brlink@debian.org>
rev_info gets a new flag first_equal_tree_only that causes
revision walks to ignore all but the first parent of equal tree
merges.
The default is off and there are options --first-equal-tree-only
and --all-equal-trees to switch it on/off respectively.
TODO:
- manpage updates
- check interaction with some of the other options
---
revision.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++---------
revision.h | 1 +
2 files changed, 49 insertions(+), 9 deletions(-)
diff --git a/revision.c b/revision.c
index a8a3c3a..fb019d6 100644
--- a/revision.c
+++ b/revision.c
@@ -452,6 +452,7 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
struct commit_list *parent = commit->parents;
unsigned left_flag;
struct commit_list *cached_base = cache_ptr ? *cache_ptr : NULL;
+ int first_parent_only;
if (commit->object.flags & ADDED)
return 0;
@@ -499,6 +500,21 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
left_flag = (commit->object.flags & SYMMETRIC_LEFT);
+ if (revs->first_parent_only)
+ first_parent_only = 1;
+ else if (revs->first_equal_tree_only && commit->parents) {
+ for (parent = commit->parents; parent; parent = parent->next) {
+ struct commit *p = parent->item;
+
+ if (parse_commit(p) < 0)
+ return -1;
+ if (p->tree != commit->tree)
+ break;
+ }
+ first_parent_only = !parent;
+ } else
+ first_parent_only = 0;
+
for (parent = commit->parents; parent; parent = parent->next) {
struct commit *p = parent->item;
@@ -511,7 +527,7 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
p->object.flags |= SEEN;
insert_by_date_cached(p, list, cached_base, cache_ptr);
}
- if (revs->first_parent_only)
+ if (first_parent_only)
break;
}
return 0;
@@ -1067,6 +1083,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->min_age = approxidate(arg + 8);
} else if (!strcmp(arg, "--first-parent")) {
revs->first_parent_only = 1;
+ } else if (!strcmp(arg, "--first-equal-tree-only")) {
+ revs->first_equal_tree_only = 1;
+ } else if (!strcmp(arg, "--all-equal-trees")) {
+ revs->first_equal_tree_only = 0;
} else if (!strcmp(arg, "-g") || !strcmp(arg, "--walk-reflogs")) {
init_reflog_walk(&revs->reflog_info);
} else if (!strcmp(arg, "--default")) {
@@ -1912,6 +1932,16 @@ static void create_boundary_commit_list(struct rev_info *revs)
sort_in_topological_order(&revs->commits, revs->lifo);
}
+static inline void add_boundary_commit(struct rev_info *revs, struct commit *c) {
+ struct object *p = &c->object;
+
+ if (p->flags & (CHILD_SHOWN | SHOWN))
+ return;
+ p->flags |= CHILD_SHOWN;
+ gc_boundary(&revs->boundary_commits);
+ add_object_array(p, NULL, &revs->boundary_commits);
+}
+
static struct commit *get_revision_internal(struct rev_info *revs)
{
struct commit *c = NULL;
@@ -1987,16 +2017,25 @@ static struct commit *get_revision_internal(struct rev_info *revs)
* 'c', we need to mark its parents that they could be boundaries.
*/
- for (l = c->parents; l; l = l->next) {
- struct object *p;
- p = &(l->item->object);
- if (p->flags & (CHILD_SHOWN | SHOWN))
- continue;
- p->flags |= CHILD_SHOWN;
- gc_boundary(&revs->boundary_commits);
- add_object_array(p, NULL, &revs->boundary_commits);
+ if (revs->first_equal_tree_only && c->parents) {
+ for (l = c->parents; l; l = l->next) {
+ struct commit *p = l->item;
+ parse_commit(p);
+ if (c->tree != p->tree)
+ break;
+ }
+ /* if all parents have the same tree as this node,
+ * it's an equal tree merge, so ignore all but the
+ * first parent */
+ if (!l) {
+ add_boundary_commit(revs, c->parents->item);
+ return c;
+ }
}
+ for (l = c->parents; l; l = l->next) {
+ add_boundary_commit(revs, l->item);
+ }
return c;
}
diff --git a/revision.h b/revision.h
index d368003..7ac263c 100644
--- a/revision.h
+++ b/revision.h
@@ -64,6 +64,7 @@ struct rev_info {
reverse_output_stage:1,
cherry_pick:1,
bisect:1,
+ first_equal_tree_only:1,
first_parent_only:1;
/* Diff flags */
^ permalink raw reply related
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