So, with Aaron's help, I am almost getting my mind around this. Maybe I am
creating my branches correctly and I just don't know how to test merging two
of them in a row into a test branch or on another machine or in a new
directory. If I can understand this, I think I am well on my way.
Here is my situation that I am trying to test. I have two branches in my
github that are useful (I think). They are related but I think
independent. The first is called mainvar and the second is inline. I want
to test putting them together in a new branch
This works:
git co -b temp github/mainvar
git rebase master
git co -b tempinline github/inline
git rebase master
git diff master
and leaves the new branches tempinline and temp exactly as I would expect.
This doesn't work and results in a conflict:
git co -b temp2
git pull github mainvar
git rebase master
git pull github inline
Is the idea of pulling a remote branch into a sub-branch a bad idea? Why
does it work with the first pull but not the second?
Here is the conflict:
def test_mainvar():
expr = 3*x*y**3+x**2*y+x**3+y**4
profile_y = {'mainvar' : y}
assert latex(expr, profile_y) == '$x^{3} + y x^{2} + 3 x y^{3} + y^{4}$'
profile_x = {'mainvar' : x}
assert latex(expr, profile_x) == '$y^{4} + 3 x y^{3} + y x^{2} + x^{3}$'
profile_y['descending'] = True
assert latex(expr, profile_y) == '$y^{4} + 3 x y^{3} + y x^{2} + x^{3}$'
profile_x['descending'] = True
assert latex(expr, profile_x) == '$x^{3} + y x^{2} + 3 x y^{3} + y^{4}$'
<<<<<<< HEAD:sympy/printing/tests/test_latex.py
=======
def test_inline():
expr = x+y
assert latex(expr) == '$x + y$'
assert latex(expr, inline=None) == 'x + y'
assert latex(expr, inline=False)== '\\begin{equation*}x +
y\\end{equation*}'
>>>>>>>
a66e0937464156e8abc6d48e8484f6ec855d36c5:sympy/printing/tests/test_latex.py
which seems trivial to me.
If the answer is, "don't use pull in that way", then that is fine and I am
good. If there is something else going on, I would like to learn about it.
Or, is there a better way to do this?
Thanks again,
Ryan
On Wed, Jun 24, 2009 at 2:18 PM, Ondrej Certik <[email protected]> wrote:
>
> On Wed, Jun 24, 2009 at 1:00 PM, Aaron S. Meurer<[email protected]>
> wrote:
> >
> > On Jun 24, 2009, at 11:23 AM, Vinzent Steinberg wrote:
> >
> > 2009/6/24 Ryan Krauss <[email protected]>
> >>
> >> So, I have a personal git sympy repo on github and have finally learned
> >> enough to be useful to the project (I hope).
> >>
> >> Question #1:
> >>
> >> One problem I ran into is that while I was figuring things out and
> >> cleaning up the mess I made of my own branches, other people submitted
> >> various patches. So, I think I correctly rebased my branches, but I
> get a
> >> lot of messages about conflicts that seem to be related to stuff that
> got
> >> added to the end of a file. When I go into edit the conflicting files,
> they
> >> look like this:
> >>
> >> def test_mainvar():
> >> expr = 3*x*y**3+x**2*y+x**3+y**4
> >> profile_y = {'mainvar' : y}
> >> assert latex(expr, profile_y) == '$x^{3} + y x^{2} + 3 x y^{3} +
> >> y^{4}$'
> >> profile_x = {'mainvar' : x}
> >> assert latex(expr, profile_x) == '$y^{4} + 3 x y^{3} + y x^{2} +
> >> x^{3}$'
> >> profile_y['descending'] = True
> >> assert latex(expr, profile_y) == '$y^{4} + 3 x y^{3} + y x^{2} +
> >> x^{3}$'
> >> profile_x['descending'] = True
> >> assert latex(expr, profile_x) == '$x^{3} + y x^{2} + 3 x y^{3} +
> >> y^{4}$'
> >> <<<<<<< HEAD:sympy/printing/tests/test_latex.py
> >> =======
> >>
> >> def test_inline():
> >> expr = x+y
> >> assert latex(expr) == '$x + y$'
> >> assert latex(expr, inline=None) == 'x + y'
> >> assert latex(expr, inline=False)== '\\begin{equation*}x +
> >> y\\end{equation*}'
> >> >>>>>>>
> >> >>>>>>>
> a66e0937464156e8abc6d48e8484f6ec855d36c5:sympy/printing/tests/test_latex.py
> >>
> >> Why can't git figure out that I just want my new function at the end of
> >> the file? What is the conflict here? How do I create patches or clean
> up
> >> my branches so that everyone who checks out my branch doesn't have to
> delete
> >> those extra lines from the supposed conflict?
> >
> > git stash # if you have unstaged changes
> > git checkout master
> > git pull
> > git checkout <branch with changes>
> > git rebase master
> > git stash apply # if you stashed above, once you are done rebasing.
> > I believe this should prevent conflicts for anyone who checkouts your
> > branch. You will have to do the merge above whenever you rebase, but
> after
> > that, no one else should have problems. This assumes that you have been
> > working in a branch and not in master (which you should do, so you can
> > rebase to master).
> >
> > I'm not sure about this one, I'd have to try out. Maybe you have to use
> "git
> > merge" explicitly?
> >
> >>
> >> Question #2:
> >>
> >> If I create a branch or patch to fix an issue that I identified, what do
> I
> >> need to do to submit the solution? Do I need to first create an issue
> on
> >> http://code.google.com/p/sympy/issues ? Is it enough to email the
> patch to
> >> this list? Can I instead email a branch I would like to suggest? Do I
> not
> >> need to email, but instead just create an issue?
> >
> > All these variants are perfectly valid and have different
> > advantages/disadvantages:
> >
> > 1. e-mail a patch: easy to comment, comfortable once "git email" works,
> can
> > be forgotten (one day hopefully not anymore)
> >
> > Are there any plans to streamline the patch process to prevent forgotten
> > patches? I have had several forgotten patches.
>
> Yes, just create an issue for every patch that you don't want to get
> forgotten and set it to NeedsReview.
>
> In the worst case, always before a release I go over all patches with
> NeedsReview and review them (I try to do it more often of course).
>
> Ondrej
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-patches" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sympy-patches?hl=en
-~----------~----~----~----~------~----~------~--~---