Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] COMPARE with latest from HEAD (and others)



On Tue, Jan 24, 2012 at 1:44 PM, Beth Tibbitts <tibbitts@xxxxxxxxxx> wrote:

OK, I tried this and it sort of works... to a point.  I can see changed files, but not added files.


 I cannot reproduce that. If I add a file, and then click Compare With->Head, it shows up as added file. It only doesn't show up if I add the file outside of eclipse and I haven't refreshed the workspace yet (so that the file doesn't show up in the Project Explorer yet). Do you have the latest version of EGit?

I documented it here: http://wiki.eclipse.org/PTP/environment_setup/git#Comparing
Roland can you check that i have described the procedure correctly?

You wrote HEAD but you seem to mean the "remote HEAD" I have corrected that. (Because if you would mean HEAD (local) than one wouldn't need to fetch first). 

"Team->Synchronize Workspace" is an alternative. It automatically fetches.

BTW: Why would you want to compare to the remote HEAD? I recommend to normally do all compare operations in your local repository. This makes it much faster and for all basic operations this is totally sufficient. 

It seems that the Git Tree Compare view that I get shows changed files, but not files that were added?
An example is the org.eclipse.ptp.pldt.tests project - Jeff changed one java file and added one.  I can see the changed java file (and manifest) but not the added one.

That seems to be a different question. So far I answered how you can see local changes you haven't committed yet. You can use the compare describe also for other things but this is the primary use I would recommend it for (and thus also recommend to compare to local HEAD not remote HEAD). 

If you want to see changes which you or other have already committed (not equal to push/pull - it could be a change only local or only remote), than I would recommend to use the history and the difference view build into the history view. I.e. to see the last changes in  org.eclipse.ptp.pldt.tests project I would select that project and then "Team->Show in History". Make sure the "Show all changes in repository..." is not selected. Now you can see only those commits which have modified this project. And when you click one of the commits you can see the files changed by that commit in the lower right corner of the history view. When you have the "Compare Mode" clicked you can also see the difference by double clicking a file.

In CVS it is normal to use the synchronized view to see changes. But this was because CVS didn't store the commits. Thus one couldn't see which files all belonged to one commit. Because Git stores that information I would always use that. The commit gives you the context in which a change was mode (both the commit message and the other files changed).

Roland
 


I am hoping that I don't have to use command line git - because I don't have it on my Mac (Snow Leopard). I upgraded my Xcode in late December and Git isn't in what I could get for Snow Leopard 




...Beth

Beth Tibbitts
Eclipse Parallel Tools Platform  http://eclipse.org/ptp
IBM STG - High Performance Computing Tools
Mailing Address:  IBM Corp., 745 West New Circle Road, Lexington, KY 40511


Inactive hide details for Roland Schulz ---01/23/2012 06:48:27 PM---On Mon, Jan 23, 2012 at 12:23 PM, Beth Tibbitts <tibbitts@uRoland Schulz ---01/23/2012 06:48:27 PM---On Mon, Jan 23, 2012 at 12:23 PM, Beth Tibbitts <tibbitts@xxxxxxxxxx> wrote: >  I have a similar que


    From:

Roland Schulz <roland@xxxxxxx>

    To:

Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>,

    Date:

01/23/2012 06:48 PM

    Subject:

Re: [ptp-dev] COMPARE with latest from HEAD (and others)

    Sent by:

ptp-dev-bounces@xxxxxxxxxxx







On Mon, Jan 23, 2012 at 12:23 PM, Beth Tibbitts <tibbitts@xxxxxxxxxx> wrote:
    I have a similar question in that i would like to be able to see the Team Synchronize view to "compare latest with head" e.g. for a whole project.

    Greg asked this question in
    http://wiki.eclipse.org/PTP/environment_setup/git#Comparing
    The answer was a lack of push/pull but my understanding is that these would result in no longer having my repo be different!
    I don't want to check in the changes, or get the changes already on the remote server, I want to *see* the changes.
    Like CVS used to be able to do with "compare with".

With Git all operations other than Push and Fetch (+ Pull because it includes Fetch) are local. Thus you cannot directly compare to a remote repository. You need to fetch the remote repository (which doesn't modify any local branches) and then you can compare to the remote tracking branches.

Roland
 
     



    ...Beth

    Beth Tibbitts
    Eclipse Parallel Tools Platform  
    http://eclipse.org/ptp
    IBM STG - High Performance Computing Tools
    Mailing Address:  IBM Corp., 745 West New Circle Road, Lexington, KY 40511


    Inactive hide details for Jeffrey Overbey ---01/23/2012 11:54:01 AM---Hi (Roland, probably), When we used CVS, you could use "RJeffrey Overbey ---01/23/2012 11:54:01 AM---Hi (Roland, probably), When we used CVS, you could use "Replace With > Latest from HEAD" to

    From:

Jeffrey Overbey <
jeffreyoverbey@xxxxxxx>
    To:

ptp-dev <
ptp-dev@xxxxxxxxxxx>,
    Date:

01/23/2012 11:54 AM
    Subject:

[ptp-dev] Replace with latest from HEAD
    Sent by:

ptp-dev-bounces@xxxxxxxxxxx




    Hi (Roland, probably),

    When we used CVS, you could use "Replace With > Latest from HEAD" to
    completely reset a project to its state in HEAD -- it would overwrite
    any local changes, delete any added files, add back any deleted files,
    etc.

    In EGit, there's a "Replace With > HEAD Revision," but it doesn't work
    the same way (at all).  I want to reset both the index and the working
    copy.

    The best I could figure is to delete the project, then git checkout
    that_project.

    Something like "stash, then reset --hard, then stash apply" seems
    ideal, but AFAIK these apply to your whole repository, not just one
    tree.

    Of course, I can't find an EGit equivalent for either of these.  (EGit
    also failed miserably when a rebase had a conflict... so I'm learning
    to use EGit only for "happy case" scenarios and fall back to the
    command line when things go wrong...)

    So... what's the "right" way to do this?  Can I stash and/or reset
    --hard just part of the repo?  Should I feel guilty for abandoning
    EGit?

    Thanks.
    Jeff

    P.S. I look forward to the fact that all of my embarrassingly naive
    git questions are being publicly archived for the rest of eternity.
    Apologies, future self...
    _______________________________________________
    ptp-dev mailing list

    ptp-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/ptp-dev





--
ORNL/UT Center for Molecular Biophysics
cmb.ornl.gov

865-241-1537, ORNL PO BOX 2008 MS6309
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev





--
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309

GIF image

GIF image


Back to the top