octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for "bar" function


From: Jordi Gutiérrez Hermoso
Subject: Re: patch for "bar" function
Date: Fri, 5 Oct 2012 10:10:03 -0400

On 3 October 2012 04:19, pantxo diribarne <address@hidden> wrote:
> diff between original.m and modif1.m  -> patch1.patch
> diff between modif1.m and modif2.m  -> patch2.patch
>
> Even though the two patch apply to different and unrelated parts of the
> code, how could the second patch be applied without the first one ?

In general, patches can be applied in any order if they do not
conflict, i.e. if they patch different parts of the code.

> Does hg diff make clever things when exporting the patch?

hg export includes some useful metadata in the patch, such as the hash
(nodeid) of the parent revision *and* the revision that will result
after applying the patch. So it's possible to apply the patch at the
exact location in history where you created it (when you created the
commit).

> At the second stage, does hg in fact export a diff between
> original.m and modif2.m excluding the modifications from the
> previous record ?

hg export exports the diff that creates a commit. A commit is a
particular state of the source tree, and it's usually expressed as
only the diff between the current commit and the parent commit (or
parent commits, plural, in case of a merge commit).

Internally, which you normally don't have to care about, hg stores the
entire contents of files, not diffs between commits, and builds
commits by getting the right revision of the file for a particular
commit. In case you're familiar with git, git's storage model is
similar in this regard.

If you find all of this confusing, you can submit pull requests
instead of patches too. Just host your hg repo somewhere public (e.g.
bitbucket, or I can set you up for now if you don't want to sign up
for bitbucket), and say which revision to pull. This is almost
functionally equivalent to submitting patches, except it's a bit nicer
for the person applying the commit to Savannah. After pulling from
your repo, I would have the exact same commit(s) as the one(s) you
created.

> Sorry for the dummy question.

I don't think this is a dummy question.

HTH,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]