Hi,

On 27 April 2011 18:13, Aaron S. Meurer <asmeu...@gmail.com> wrote:

> On Apr 27, 2011, at 4:56 PM, Ondrej Certik wrote:
>
> > On Wed, Apr 27, 2011 at 11:16 AM, Aaron S. Meurer <asmeu...@gmail.com>
> wrote:
> >>
> >> On Apr 26, 2011, at 9:00 AM, Tom Bachmann wrote:
> >>
> >>>
> >>>>> (1) "Waterfall". Review [1], I do any requested changes, then you
> push
> >>>>> it in. Same for [2]. Then I cherry-pick [3] on top of master (might
> >>>>> take a few hours), and when that is done proceed as before with [3].
> >>>>
> >>>> You do know about the "git rebase" command, right? That is the
> equivalent of cherry-picking multiple commits.  Or am I misunderstanding
> you?
> >>>>
> >>>
> >>> Well I do, but I haven't found it quite satisfactory. Let me describe
> >>> what I do, I suppose there is going to be a better way.
> >>>
> >>> Suppose I want to develop a succession of features called A and B. B
> >>> depends on A and is what I am really after, but A is also quite nice
> >>> in itself and moreover a convenient stage to get code pushed into main
> >>> branch.
> >>>
> >>> So I develop on branch-A, something like this:
> >>>
> >>> A1-A2-A3
> >>>
> >>> I then think the code is fine and submit a pull request. Obviously I
> >>> don't want to stop coding (I want B!!!), so I create branch-B on top
> >>> of A3 and code along:
> >>>
> >>> A1-A2-A3-B1-B2
> >>>
> >>> then one of those pesky reviewers [*] comes along and wants me to add
> >>> some whitespaces in commit A2. I do it, and of course I rebase my
> >>> branch A. But now we have got a problem:
> >>
> >> Well, the solution to that is to not have whitespace errors in the first
> place :)
> >>
> >> But seriously, if you are just fixing whitespace errors, you probably
> don't need to have a separate commit.  In that case, you can just do "git
> rebase -i master" (in your branch), and mark the offending commits as
> "edit". Then, fix your whitespace errors and do "git commit --amend".
> >
> > If you use vim, put this into your .vimrc:
> >
> > if has('gui_running')
> >   hi WhiteSpaceEOL guibg=#FF0000
> > else
> >   hi WhiteSpaceEOL ctermbg=Red
> > endif
> > match WhitespaceEOL /\s\+\%#\@<!$/
> >
> >
> > and it will highlight all whitespace errors. Since then I never have
> > to worry about that.
> >
> > Ondřej
>
> I found a plugin to XCode that actually strips all trailing whitespace on
> save.  I haven't had any errors since then (and the best part is that I
> don't have to manually clear them).  Maybe vim (or whatever editor you use)
> has something similar.
>

You can, e.g.:

" Remove trailing whitespace
function! TrimWhiteSpace()
    if &filetype != 'mail'
        let s:origpos = getpos('.')
        % substitute /\s\+$//e
        call setpos('.', s:origpos)
    endif
endfunction

autocmd BufWritePre * call TrimWhiteSpace()

(this is what I use).


>
> There is also something you can put in your gitconfig file that keeps git
> from committing whitespace errors, though I've had problems with it in the
> past (it tried to do it during rebasing, and so I couldn't continue with the
> rebase; but maybe they've fixed the bug by now).
>
> Aaron Meurer
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
>
Mateusz

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to