I've finally upgraded an old project from a folder of downloaded js-libs, which were committed to the repository, to bower. It works great, using a new library is great, upgrades are much easier, but - what if a package is broken?
In this specific case, there is a small bug in the library, which affects me hugely. A solution has been submitted via PR 2 months ago, but hasn't been merged yet. And even if it gets merged, it doesn't mean a new version will be published right after.
What is the best way to apply the fix myself, in a way, that I could switch back to the official package, whenever a new and fixed version has been published.
I see two options:
download the code (as I used to have it) and modify it locally + commit it into the repo
fork the original project, merge the change into the project and publish it as a new (temporary) bower package
1st solution seems stupid and 2nd a bit too complicated just to change one line of code. In either case I'd need to keep my eyes opened if something has changed and switch back and forth manually.
Are those the only two options, or am I missing something?
Related
Im not sure this is the right place for this but I need an answer - in the past I have always saved backups (so I can revert back if I break something) of my Xcode projects by copy-pasting the project folder with the project tests/files inside (image below) and naming it a new version (i,e Project 1, project 2, so on):
This has worked well and in the past Ive been able to simply delete a screwed up version and open a past one and the code will be as I left it.
I have now started incorporating pods into my project so I am using the workspace instead of the Xcode project. This now brings in the issue of build "schemes" which appear in the upper left corner.
Not always, but sometimes after copy-pasting I will go back to a previous version and the code has "carried over" from the latest version/scheme. I don't really understand what a scheme is or if this is the problem but it has caused major problems at times.
When using the workspace, how does one properly save backups/new versions to go back to?
It sounds like you need a source control tool, the most used Source Control Management tool is called git. It's what a lot of people use, and you may have heard of GitHub - which is centered around git.
I'd recommend starting by going through this website: https://try.github.io/
As others have mentioned, you should definitely get acquainted with git. And the good news is that about a year after this question was asked, with the release of Xcode 9 (and with all subsequent versions since then), git is built right into Xcode. When you create a project, on the screen where you select the folder you would like to save the project to, you will see a check box, as in this screenshot:
Always enable this (i.e., check the box), and you will never again need to manually save versions of your project to separate folders, as you outlined.
Cheers!
I have a project that publishes its jars to ivy. For code that is currently in development it publishes as 1.DEV.x. This has worked mostly well for keeping everyone integrating on track.
I have noticed the minor versions have no longer matched and I would like to match them back up. For example, some dependencies show a minor version of 60, while some show 10. In fact, they have completely stopped incrementing revisions at all. This is bad because now for projects to properly resolve, they must run a clean-ivy-cache command to pick up the changes.
Today, I cleared all 1.DEV.x dependencies from ivy by deleting all containing folders. There are a few dependencies that have started at minor version 6 (not sure why its not 0) and the rest at their usual number. The current problem is now the projects that depend on these can't seem to find them. For example, one dependency with minor version 6 says it found it at version 7, but when trying to download, throws an error because it isn't there. The work around is to create the folder, rename the dependencies, and re run the build.
I would like to have it start over at minor version 0, and would also like it to continue incrementing. I can't seem to find anywhere where that could be reset.
You need to clear the dependencies and the configuration. When you publish, look at the two sets of files being uploaded.. clear both of these.
I want to be able to see (in VS2013 UI) till which change-set I updated my files.
The reason I ask this is because of the following scenario:
I created a fix, checked it in and continued working on something else. One day later, my colleague is testing the bug I solved but found it unsolved. Next, I tried to reproduce it at my machine but was not able to do so. So I wondered whether my colleague got the latest version before starting to test, he was convinced he did, but we cannot find a way to see on what change-set he is.
It is important for us to know this information without getting the latest version and retest it. Since the testing procedure for this bug takes quite some time, and time is valuable.
I'm quite new to TFS and we just switched from SVN to TFS. At SVN, using tortoise, the revision of the local working copy was highlighted, so the user knew which revisions he missed or was at.
I would like to be able to get this same information via VS2013.
I searched the web and found this other question but it uses the command line and I want to see it in the UI. Beside that, I couldn't get the command to work.
The question: Where can I find the number of the change-set in the VS2013 user-interface, my local working copy is on?
One place I know of is in the source control explorer window of Visual Studio.
1: right click a file and go to Advanced->Properties
2: Under the general tab you will see "Workspace Version #" and "Latest Version #"
In the Source Code Explorer you should have a column for "latest". This will tell you at a glance if you have the latest or not.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What is a version control system? How is Git useful?
I am new to Ruby on Rails platform, and so this may sound a little naive.
Why and when do we store our work in a version control system like git?
I mean what is the advantage of it ! Can't we just keep it in our local machine ?
Advantages for using git/source control:
For yourself
Remembering what you have coded and when you did it
Being able to compare what you did to previous work
Allow you to work on something experimental, and if it doesn't work switch it back to where it was before
Working with a team
It makes working with others easier - you can work on the same file at the same time and really easily combine your changes.
It will allow you to work in multiple locations and easily have the most recent code
It will help in deploying your code to a server
Git workflow for teams
Git branching model
When to store or commit your work:
You want to do this each time you finish on a particular "idea" or piece of work you are working on. This means you can have a useful commit message and can go back im time to that feature you just wrote or that bug that you just fixed.
How often and when to commit
Reasons for using Git over other source control
Its fast (switching branches is really fast and you have a local copy, so you dont have to communicate to a server for a lot of things unless you want to push or pull changes to the server)
Yes, this seems quite naive, but every question is worth asking!
First of all, using a SCM (software configuration manager) will greatly help you in a number of scenarios:
trying out experimental features without touching the main code
developing several independent ideas at the same time
recovering from failed changes, whenever they are complex and include changes in multiple files.
tracking the exact code used in a specific release, to fix a reported bug.
This doesn't even start to touch the infinite amount of work you'd have if working in a team without SCM.
And using a SCM doesn't involve network, git and any other distributed SCM is equally valid for local development, as the repository is all in your computer. You just don't pull and push.
The choice is not whether to store code in version control versus storing it on your local machine. In fact, unlike other version control systems (like Subversion, known also as svn), Git does not need a server to run.
Version control makes it easy to understand what changes were made, view and restore older versions of files, and even import changes from one version to another.
RETRIEVAL: Imagine you are working on a project on your own. You delete an old file you don't think you need anymore. A week later, you realize that the file was very important. If you use version control, you can see what the file looked like just before you deleted it, and restore it as if it were never deleted. Also, most changes committed to version control contain messages; if you join a team and the previous developer used version control (with good commit messages) you can get an easier context for when changes were made and why.
MULTIPLE RELEASES (BRANCHES): Now imagine that your software is version 1.0. You're busy working on version 2.0, but someone files a bug. What can you do? With version control, you can zoom back to version 1.0, make some changes, and then create version 1.0.1. Most version control platforms even let you apply the changes made in version 1.0.1 onto the work you're doing in version 2.0.
MULTIPLE FEATURES: Your software is so successful, you start releasing it weekly. However, not every feature is ready for release. First you start working on the widget feature, than you start working on the doodad feature. If you work on both of these at the same time, you may have two half-coded features in development at the same time, and nothing is working well enough to release. With version control, once one of the features is done, you can merge it into the "main" release as if you wrote it in one day.
COLLABORATION: Finally, now imagine that you're in a team of five or six developers all working on the same code. Naturally, you don't want to email zip files of code back and forth, especially when every developer is working on a separate feature. With version control, you can have a single history, to which all of your developers write and read.
Naturally, some of the above can be done by keeping multiple copies of the same files in different adjacent directories. The benefit of version control software is that it can handle much of the work for you while avoiding duplicating the same file over and over on your disk.
Long winded--sorry--but hope that helps!
Advantages of using git:
Code will be safe in remote repo, even if the local project crashes
You can try out new things without worrying about previous works as they can retrieved
The code can accessed from anywhere in the world
When working in team, all the work will be stored in a single place so that it will be accessible to everybody in your team
Each and every change can be tracked easily, who did it and when they did it
Deployment of application will more easier
You can have multiple versions/branches so that it will be easy for you to identify the new features added to the application in every version
you see #arulmr, #kieran-andrews, #Jeff and #rewritten that post many advantages but still if you want learn more in details you can see below links
1) http://git-scm.com/book/ch8-1.html
2) http://www-oss.fnal.gov/~mengel/git_vs_subversion.html.bak
3) https://git.wiki.kernel.org/index.php/GitSvnComparison
4) http://www.wikivs.com/wiki/Git_vs_Subversion #History, Architecture, Licensing, Performance, Features of git and svn
now the difference between git and subversion
1) http://boxysystems.com/index.php/5-fundamental-differences-between-git-svn/
(I don't really care if it's my fault but rather why things are happening, of course...)
I have a rails site in SVN on a remote server. On my local copy I do a switch (svn switch http://whatever/branch .), and then things are totally bizarre and the site doesn't work. I finally track it down and it turns out that part of the build (particularly, the app/config directory) is pointing to the wrong branch. Please note:
I never switch using anything other than the SVN command line
I only switch at the root of the installation
I always switch as root (sudo -s) and I'm sure that the permissions were set correctly on the whole tree (chmod -R 777)
Any ideas on how part of the working directory could end up pointing to the wrong place? In my memory, this is not the first time that some sub of the working directory is pointing to the wrong place... why would this happen?
There is a whole section about switch problems in the official Subversion FAQ. It says:
In some cases where there are
unversioned (and maybe ignored) items
in the working copy, svn switch can
get an error. The switch stops,
leaving the working copy
half-switched.
Their advice is to only switch from a clean working copy.
Another thing is Mixed Revision Working Copies.
Basically this means that the files in your working copy can be (and normally are) from
different revisions.
Here is what the SVN Red Book has to say about this (emphasis by me):
For example, suppose you have a
working copy entirely at revision 10.
You edit the file foo.html and then
perform an svn commit, which creates
revision 15 in the repository. After
the commit succeeds, many new users
would expect the working copy to be
entirely at revision 15, but that's
not the case! Any number of changes
might have happened in the repository
between revisions 10 and 15. The
client knows nothing of those changes
in the repository, since you haven't
yet run svn update, and svn commit
doesn't pull down new changes. If, on
the other hand, svn commit were to
automatically download the newest
changes, then it would be possible to
set the entire working copy to
revision 15—but then we'd be breaking
the fundamental rule of “push” and
“pull” remaining separate actions.
Therefore the only safe thing the
Subversion client can do is mark the
one file—foo.html—as being at revision
15. The rest of the working copy remains at revision 10. Only by
running svn update can the latest
changes be downloaded, and the whole
working copy be marked as revision 15.
Excuse me if you know what you're doing, but it sounds like you aren't. (Or the question isn't clear). If you include the results of svn status from the relevant directories, we could get farther.
svn switch
(svn help switch)
is for switching repositories, which shouldn't part of a common workflow.