On Tue, May 25, 2010 at 22:38, Jordan Lewis <jordanthele...@gmail.com> wrote:

> For example, pretend you're developing the ultimate novel Vim feature, but
> you've caused a bug, and want to trace it in gdb. You edit Vim's makefile to
> enable -g in CFLAGS, recompile, track down the bug, and want to compile a
> release version. I wouldn't have committed enabling -g in git, as it's a
> transient change that I don't want to make permanent. So I edit again and
> undo the change.

% git checkout -- Makefile

> As another example, pretend you're editing your Apache config in an attempt
> to get a new module working on your web page. The workflow here is a tight
> loop - edit, reload apache, test, repeat.

% <<EOF >> Makefile
install_and_reload:
        install httpd.conf && /etc/init.d/apache reload
EOF
% vim httpd.conf
# Edit
:mak[e] install_and_reload
# Edit more
@:

:make even saves the buffer for you, so that’s all you need to do.

> If it's too much overhead in this tight loop to continue committing small 
> changes to git, then it's no problem to undo the failed couple lines of new 
> configuration and try again.

If you’re referring to a lot of unnecessary git commits, which, again,
I wasn’t suggesting, you can always use git rebase --interactive to
weed out, join, and reorder commits.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui