Issues doing a rollback in p4 - version-control

I did a manual merge from branch A to B. It caused a build failure and I decided to rollback the manual merge. But when I tried to integrate from A to B again, it did not pick up the changes from A that I rolled back.
This seemed very weird - I was expecting things to work like in git, after a git revert.
Please let me know how I can get branch B back to the exact state it was before my manual merge and how I can successfully merge from A to B again. Thanks!

I encountered the issue as well and had the same reaction.
Perforce is actually tracking what has been integrated between branches. You can display it with the command p4 integrated.
In this case, the solution is to force the integration again with a force option.
In P4V, there is an option in the Advanced tab in the Merge menu, and by command line you have to use something like
p4 integrate -f ...
Similar questions and answers here : Unable to integrate fully from main branch to feature branch, after backing out a previous messed-up integration

Related

Going to another commit in GitHub Desktop (GUI VERSION)

How do I go to a previous commit from GitHub Desktop? I did some work in my class yesterday and today when I pulled it said I needed to resolve merges, so I clicked continue from Main. Now I do not have the version in my unity, but I do have it in History. I would like to go back to that version.
I do not have the command line, please only options on GUI version.
I do not want to try anything without asking because last time it caused a lot of errors and corruption in my previous project.
Create branch from commit is probably your best bet. It will ask you to enter a name for the new branch. Once your done you can use the branch tab to switch back to your development branch.

Changing branches in Perforce

The client has asked me to submit changes into a different, pre-existing branch in their Perforce repo, but I'm having a tough time figuring out the process for that.
What's the Perforce equivalent of git checkout other-branch? Search engines are failing me; possibly because I'm using Git terminology and/or concepts that don't actually exist in p4.
Once I have the other branch "checked out" or whatever the correct p4 terminology is, can I just create and submit my changesets in the normal way?
Are there any caveats to doing this in the CLI versus p4v? I've mostly been using the latter because I'm a n00b.
Branch specs in Perforce are just different paths. If you have something like
//depot/product/main/...
in your p4 client spec, you'd change it to
//depot/product/branch/...
to get the branch, and use p4 sync to get the files and p4 add/edit/delete/submit as per usual to make changes. You'd merge changes between branches using p4 integrate.
See the Perforce docs for more info.
p4 workspace is the command you want. If you're using p4v you can just add that branch to a new workspace.
You may also find this handy dandy comparison chart useful. http://www.perforce.com/sites/default/files/command-comparison.pdf
Or this cheat sheet: https://jira.atlassian.com/secure/attachment/91198/cheat_sheet.pdf

GitHub - Change Misspelled Commit Message

Is there a way in GitHub to change a commit message if I've committed with a message that has a typo or something dumb written in it?
I know you can do the ammend commit thing (which replaces the previous commit) from the CLI, but is there a way to just edit the commit message from the GitHub.com site interface?
If the problem commit is more than one commit ago, you have to fall back to interactive rebase. For example, if you notice a misspelling three commits ago, you would type something like this:
git rebase -i HEAD~4
Then rebase would open up your default editor with a view that looked something like this:
pick c5052cb Updated the workshop instructions
pick 6d6cd60 Upgraded to the plugin 0.6.1
pick c6d0921 Upgraded wrapper to Gradle 1.2
pick 7a111da Upgraded to 0.7 of the Liquibase Gradle Plugin.
# Rebase 097e6b2..7a111da onto 097e6b2
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
You'd want to edit the third line (the one referring to commit c6d0921) to start with the word "reword" instead of "pick." Once you save and exit from the editor, you'll find yourself right back in the editor with that commit's message in front of you. Correct your misspelling, save and exit, and all is well.
Note that doing this or doing a commit --ammend is dangerous business if you've already pushed these commits to an upstream repo. This is why there's no way to do this on GitHub.com directly. If you want to change commits you've already pushed, that's a separate matter entirely. :)
There isn't a way to do it directly on the site.
You could:
git commit --amend
git push --force origin master
One of the main reasons we don't want to allow people to do this on the site is because it'd change the entire structure of the commit (basically just think of this as changing the commit hash). This isn't a problem when it's only you, but for the sake of a community of people working with you, this is a problem because no one else will have that commit, and when they try to pull they run into issues.
This is the same as doing the ammend on the command line AFTER you've pushed, then force pushing to github.com. Usually a major no-no for workflows unless you take care with a lot of extra communication.

Egit vs Git showing changes on multiple branches?

We've recently moved to Git and are using Egit in Eclipse Juno and have noticed a problem with branch switching. The sequence is:
In BranchA make a change
Do not stage or commit change
Switch to BranchB
Problem:
No error to recommend stash/abandon/commit changes
BranchA change shows up in BranchB
Make change in BranchB
Do not stage or commit change
Switch to BranchA
Problem:
No error to recommend stash/abandon/commit changes
BranchB change shows up in BranchA
This seems very counter-intuitive as it appears Egit it mixing uncommitted changes among branches? I have to be doing something wrong as this couldn't be the case.
When I complete the same steps at the Git command line I get the behaviour I expect i.e. the abandon/stash/commit alert halts the switch to the new branch and have to complete one of those steps and their is not bleeding between branches.
The command line behaviour is the one I expect and makes sense to be. Could someone tell me if my experience is correct with Egit or should it be like the command line?
Thanks for your help.
I don't think your test was accurate. The command line will also switch without an error as long as - and that's the important point here - the switch wouldn't overwrite any of the uncommitted changes in the working directory.
Furthermore, your terminology is off:
You don't make changes in a branch. You make changes in your working directory.
Uncommitted changes do not belong to any branch. Your mental model is wrong, there is no issue with the tools.

cvs: updates fail to merge

I've just discovered, a surprising for me behavior of cvs.
I change file1 localy
During this time people change other unrelated parts of the same file, and commit to the repository
I update my local copy from repository
At this point I expect my local copy of file1 to contain all changes made by others to this file, unless the update above reported a conflict. However, when I do now diff with head, I discover lot's of differences coming from changes made by others in parts of the file that I did not touch at all.
Any ideas? Is this just the limited abilities of cvs to merge? Any wrong setting? Something in my workflow?
CVS has very limited merge facilities. Switch to a modern system such as Git (perhaps via git-cvsimport if the repo maintainer is uncooperative) if you want a better merge experience. See also Best practices for using git with CVS
The final solution is :
1. Save your local code to another place manually
2. Revert the files which may has conflict to the HEAD (most latest) version on CVS server.
3. Add back your change to the Reverted file.
The concept for above solution is to CLEAR UP all the possible issue by REVERT and get a 100% clean version from repository then add back our changes.
It can resolve below issues which caused by code out of date / code base messed up.
CVS commit had a conflict and has not been modified
CVS update failed
CVS not sync