Re: Committing Line by Line Changes?

2011-07-27 Thread Peter Boughton

As has been said, Git was built knowing that branching is an important task - 
and so creating and using branches is easy, fast, and flexible.

(I used to work on a large project that used SVN, and I had half a dozen 
checked-out copies because I often worked on multiple things and switching 
branches with SVN was so slow.)

I very much recommend the branching strategy Jonah linked to ( 
http://nvie.com/posts/a-successful-git-branching-model/ ), it might seem like 
overkill, but it really does make sense.


I'm also going to repeat a couple of things that have already been said, 
because I think it's beneficial to say them in a different way. :)


Git allows you to move all uncommitted changes to a temporary branch, and to 
retrieve again later, using "git stash" command.
Also, if you want to, you can convert stashes into real branches (with a single 
command).

See http://www.kernel.org/pub/software/scm/git/docs/git-stash.html for info.


Git allows changes to be staged in parts with "git add --patch " - 
this will step you through a list of changes in that file, and allows you to 
indicate if each change should be staged or not, as well as splitting each one 
into smaller changes.

I do this all the time, when I've got multiple unrelated changed that each 
deserve independent commit messages.
Once you understand what's happening, it's not hard to handle. (Unless the 
changes are not unrelated, but that's a different problem.)

Details at http://kernel.org/pub/software/scm/git/docs/git-add.html


Also worth pointing out, aside from those man pages, there's a number of good 
documentation sources for git:

http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
http://progit.org/book (also available as a physical book)
http://book.git-scm.com 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346378
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Sean Corfield

On Wed, Jul 27, 2011 at 9:16 AM, Shannon Rhodes  wrote:
> I've been charged with choosing versioning software for our team, and I'd 
> like to recommend Subversion but there's a developer who wants a feature that 
> I'm not sure Subversion (or other versioning tools) can accommodate:  partial 
> commits.

As others have noted, Git supports this although, as Dave implied,
picking just a line or two to commit can be nigh on impossible if
you've already got changes in that area uncommitted.

However, Git offers a number of benefits over SVN for the sort of
workflow you're talking about. First off, you can simply stash
uncommitted changes, work on the emergency fix, commit & push that,
then unstash (pop) your changes and the emergency fix will be
auto-merged back in if possible (otherwise manually fix the merge and
drop the stash entry). Second, in Git, branches are very cheap so you
tend to use them for any non-trivial changes. You branch _locally_,
work on your big feature, switching back and forth between your local
branch and the stable branch if needed to fix issues (and then merging
them into your branch - again, a mostly automated task in Git), and
when your done on your feature, commit and merge it back to the stable
branch.

Git also allows offline commits (since the repo is local) which can be
very useful if team members travel a lot. It lets me work on trains
and airplanes easily. When I get to a wifi spot, I just pull updates
and push my commits.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346376
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread .jonah

The one I'm liking the most so far is P4merge. It's part of the Perforce 
system, but is free, cross platform, and works great with other SCMs 
like Git.

http://www.perforce.com/product/components/perforce_visual_merge_and_diff_tools
http://www.perforce.com/downloads/complete_list

On 7/27/11 12:04 PM, Larry Lyons wrote:
> Another good diff tool is WinMerge (http://www.winmerge.org) its a free diff 
> and merge tool.
>
>> I use Beyonf Compare for stuff like this and I have to say I probably
>> couldn't live without this tool now, it is s useful.
>> You can compare files locally, or even an FTP connection and deploy changes
>> to your live site this way.
>> you can merge line by line of course.
>>
>> Seriously, try it out, the trial version never expires either.
>>
>> http://www.scootersoftware.com/
>>
>> Russ

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346375
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Larry Lyons

Another good diff tool is WinMerge (http://www.winmerge.org) its a free diff 
and merge tool.

>I use Beyonf Compare for stuff like this and I have to say I probably
>couldn't live without this tool now, it is s useful.
>You can compare files locally, or even an FTP connection and deploy changes
>to your live site this way.
>you can merge line by line of course.
>
>Seriously, try it out, the trial version never expires either.
>
>http://www.scootersoftware.com/
>
>Russ
>
>
>
>> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346374
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread .jonah

Yes, in Git you can "stage" individual lines, commit only those and 
you'll have the rest of your changes uncommitted in your workspace.

Like Judah said, you should be working on your new feature or release or 
whatever in its own branch and committing often - even if it's not 
complete or working, since you're committing locally anyway, it's not 
affecting anyone else. (Here's a nice branching model we've adopted: 
http://nvie.com/posts/a-successful-git-branching-model/)

So, to make a quick change, commit your work in progress, checkout the 
hotfix branch, make the change, commit it, push that branch to 
release/production, then re-check out the feature branch you were 
working on.

Git makes this all really easy and you want to do it this way since a 
big part of using version control is to have clear tracking of what 
changes mean what.

.jonah

On 7/27/11 10:22 AM, Larry Lyons wrote:
> If I remember correctly, you can also cherry pick your final commits in git. 
> So effectively that's a line by line commit.
>
>> With Git and Mercurial, you can "shelve" changes. So if you are part
>> way through a big change and something important comes in, you can
>> tell the source control system to stash the current changes out of
>> the
>> way, go back to your version prior to the current changes, make the
>> new important changes and commit them, then pull the uncommitted
>> stuff
>> you were working on back into your working branch and go on your
>> merry
>> way.
>>
>> Judah
>>
>> On Wed, Jul 27, 2011 at 9:28 AM, Shannon Rhodes> com>  wrote:
>>> Yeah, what Dave said...I'm talking about committing part of a file,
>> not part of a project.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346373
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Russ Michaels

I use Beyonf Compare for stuff like this and I have to say I probably
couldn't live without this tool now, it is s useful.
You can compare files locally, or even an FTP connection and deploy changes
to your live site this way.
you can merge line by line of course.

Seriously, try it out, the trial version never expires either.

http://www.scootersoftware.com/

Russ

On Wed, Jul 27, 2011 at 6:22 PM, Larry Lyons  wrote:

>
> If I remember correctly, you can also cherry pick your final commits in
> git. So effectively that's a line by line commit.
>
> > With Git and Mercurial, you can "shelve" changes. So if you are part
> > way through a big change and something important comes in, you can
> > tell the source control system to stash the current changes out of
> > the
> > way, go back to your version prior to the current changes, make the
> > new important changes and commit them, then pull the uncommitted
> > stuff
> > you were working on back into your working branch and go on your
> > merry
> > way.
> >
> > Judah
> >
> > On Wed, Jul 27, 2011 at 9:28 AM, Shannon Rhodes  > com> wrote:
> > >
> > > Yeah, what Dave said...I'm talking about committing part of a file,
> > not part of a project.
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346372
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Larry Lyons

If I remember correctly, you can also cherry pick your final commits in git. So 
effectively that's a line by line commit.

> With Git and Mercurial, you can "shelve" changes. So if you are part
> way through a big change and something important comes in, you can
> tell the source control system to stash the current changes out of 
> the
> way, go back to your version prior to the current changes, make the
> new important changes and commit them, then pull the uncommitted 
> stuff
> you were working on back into your working branch and go on your 
> merry
> way.
> 
> Judah
> 
> On Wed, Jul 27, 2011 at 9:28 AM, Shannon Rhodes  com> wrote:
> >
> > Yeah, what Dave said...I'm talking about committing part of a file, 
> not part of a project.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346371
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Judah McAuley

On Wed, Jul 27, 2011 at 10:08 AM, Dave Watts  wrote:
>
>> With Git and Mercurial, you can "shelve" changes. So if you are part
>> way through a big change and something important comes in, you can
>> tell the source control system to stash the current changes out of the
>> way, go back to your version prior to the current changes, make the
>> new important changes and commit them, then pull the uncommitted stuff
>> you were working on back into your working branch and go on your merry
>> way.
>
> But you're still going to have to be able to incorporate the changes
> that were made since your last checkout line-by-line, right? For
> example, if you check out somefile.cfm and change lines 50-75, then
> the important change affects lines 20-30, you're going to have to go
> back and diff the files before you can commit the changes you made
> before you shelved the file.

Of course, but if you are going to be changing the same line in each
of the commits you want to put out, you're going to have to do a merge
no matter what, even if you commit line by line.  The way I
interpreted the question is that the poster is looking for an easy way
to stop part way through some changes, switch over to do something
else in the same code area, then come back to finish up and
incorporate the changes they made during the digression.

In Git or Mercurial, I actually wouldn't probably use changeset
shelving either, though it is certainly possible. I'd create a new
branch from the last common point, switch to the new branch, make
changes and push/build/whatever, then merge that branch back to your
main development branch. If the changes were in a different section of
code, even in the same file, Git or Mercurial should be able to do the
merge automatically for you. If you changed the same line in both
change sets, you'll need to resolve the merge conflict with the
merge/diff tool of your choice.

Judah

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346370
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Dave Watts

> With Git and Mercurial, you can "shelve" changes. So if you are part
> way through a big change and something important comes in, you can
> tell the source control system to stash the current changes out of the
> way, go back to your version prior to the current changes, make the
> new important changes and commit them, then pull the uncommitted stuff
> you were working on back into your working branch and go on your merry
> way.

But you're still going to have to be able to incorporate the changes
that were made since your last checkout line-by-line, right? For
example, if you check out somefile.cfm and change lines 50-75, then
the important change affects lines 20-30, you're going to have to go
back and diff the files before you can commit the changes you made
before you shelved the file.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346369
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Shannon Rhodes

Great info, thanks for the fast replies! 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346366
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Mike Chabot

Shannon,
You can accomplish this goal indirectly with Subversion. You could check out
the committed version of the file to a different location, check out an
older copy of the entire site, or use the branching feature, make the change
to that other copy of the file/site, then commit that other file without
impacting the current development directory. I've done this sort of thing
many times. An alternative is that the developer can comment out the code
that is not ready to commit, then uncomment the code when development on it
restarts. Another alternative is to move the current development copy of the
file to a different directory outside of the site, download the version from
source control to modify it, then when that modification is complete and
checked in, use a diff tool to merge the two files.

I am not aware of any source control tool that lets you directly pick
individual lines of code to commit.

-Mike Chabot
On Wed, Jul 27, 2011 at 12:16 PM, Shannon Rhodes wrote:

>
> I've been charged with choosing versioning software for our team, and I'd
> like to recommend Subversion but there's a developer who wants a feature
> that I'm not sure Subversion (or other versioning tools) can accommodate:
>  partial commits.  For example, you may be working on a project where you've
> touched a lot of code that is not ready for check-in, but then a high
> priority change comes across your desk that requires you to make an
> unrelated change to one of these files and check it in.  He wants to be able
> to pick and choose which lines of a changed file get checked in.  Is that
> possible with any versioning tool??
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346365
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Judah McAuley

With Git and Mercurial, you can "shelve" changes. So if you are part
way through a big change and something important comes in, you can
tell the source control system to stash the current changes out of the
way, go back to your version prior to the current changes, make the
new important changes and commit them, then pull the uncommitted stuff
you were working on back into your working branch and go on your merry
way.

Judah

On Wed, Jul 27, 2011 at 9:28 AM, Shannon Rhodes  wrote:
>
> Yeah, what Dave said...I'm talking about committing part of a file, not part 
> of a project.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346364
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Shannon Rhodes

Yeah, what Dave said...I'm talking about committing part of a file, not part of 
a project. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346360
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Dave Watts

> I've been charged with choosing versioning software for our team, and I'd 
> like to recommend Subversion but there's a developer who wants a feature
> that I'm not sure Subversion (or other versioning tools) can accommodate:  
> partial commits.  For example, you may be working on a project where
> you've touched a lot of code that is not ready for check-in, but then a high 
> priority change comes across your desk that requires you to make an
> unrelated change to one of these files and check it in.  He wants to be able 
> to pick and choose which lines of a changed file get checked in.  Is that
> possible with any versioning tool??

I don't think it is. All the tools I've seen treat files as atomic for
checkin purposes.

That said, this is why we have diff tools. Use the diff tool with your
local copy, build a new copy with the lines you want and check that
in. Beyond Compare is a great diff tool if you're on Windows.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or ons

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346359
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Dave Watts

> Yeah Subversive SVN plugin for eclipse and ColdFusion builder does this, you
> can commit a file, folder or when you click on the whole project folder
> select ONLY certain files contained within the project that you want to
> commit and leave the rest alone.

I don't think SVN supports committing specific lines of a file, though.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346357
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Committing Line by Line Changes?

2011-07-27 Thread Casey Dougall

Hi,

Yeah Subversive SVN plugin for eclipse and ColdFusion builder does this, you
can commit a file, folder or when you click on the whole project folder
select ONLY certain files contained within the project that you want to
commit and leave the rest alone.



On Wed, Jul 27, 2011 at 12:16 PM, Shannon Rhodes wrote:

>
> I've been charged with choosing versioning software for our team, and I'd
> like to recommend Subversion but there's a developer who wants a feature
> that I'm not sure Subversion (or other versioning tools) can accommodate:
>  partial commits.  For example, you may be working on a project where you've
> touched a lot of code that is not ready for check-in, but then a high
> priority change comes across your desk that requires you to make an
> unrelated change to one of these files and check it in.  He wants to be able
> to pick and choose which lines of a changed file get checked in.  Is that
> possible with any versioning tool??
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346356
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Committing Line by Line Changes?

2011-07-27 Thread Shannon Rhodes

I've been charged with choosing versioning software for our team, and I'd like 
to recommend Subversion but there's a developer who wants a feature that I'm 
not sure Subversion (or other versioning tools) can accommodate:  partial 
commits.  For example, you may be working on a project where you've touched a 
lot of code that is not ready for check-in, but then a high priority change 
comes across your desk that requires you to make an unrelated change to one of 
these files and check it in.  He wants to be able to pick and choose which 
lines of a changed file get checked in.  Is that possible with any versioning 
tool?? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346355
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm