[yast-devel] Moving Clients to 'lib' && Keeping the History
Hi, You probably remember that Martin has moved code from installation clients from src/clients to src/lib/installation/clients recently, unfortunately this move has removed all the history from those new files [#1][#2]. I've found a way how to move the content and still keep the history [#3][#4], this is what I did: 1. Moved files from scr/clients to lib/users/clients with `git mv` 2. Pushed this change as a separate commit to my repo 3. Added new clients to scr/clients calling lib/users/clients/* 4. Adapted Makefile.am in src to rake (take) care about libs 5. Pushed again The trick was to persuade git that I have just moved files from one location to another. I've probably discovered America today, but it still might be helpful to you :) Bye Lukas #1 https://github.com/yast/yast-installation/blame/master/src/clients/clone_fin... #2 https://github.com/yast/yast-installation/blame/master/src/lib/installation/... #3 https://github.com/kobliha/yast-users/blob/make_skipping_user_intuitive/src/... #4 https://github.com/kobliha/yast-users/blame/make_skipping_user_intuitive/src... -- Lukas Ocilka, Systems Management (Yast) Team Leader SLE Department, SUSE Linux -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
# lukas.ocilka@suse.com / 2015-12-04 13:55:00 +0100:
Hi,
You probably remember that Martin has moved code from installation clients from src/clients to src/lib/installation/clients recently, unfortunately this move has removed all the history from those new files [#1][#2].
I've found a way how to move the content and still keep the history [#3][#4], this is what I did:
1. Moved files from scr/clients to lib/users/clients with `git mv` 2. Pushed this change as a separate commit to my repo 3. Added new clients to scr/clients calling lib/users/clients/* 4. Adapted Makefile.am in src to rake (take) care about libs 5. Pushed again
The trick was to persuade git that I have just moved files from one location to another. I've probably discovered America today, but it still might be helpful to you :)
git does not track moves/renames. unlike some other versioning tools like svn or hg, git does not attach any "identity" to a file. i don't know what "this move has removed all the history from those new files" means, but it's probably about a github's shortcoming. -- roman -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Fri, 4 Dec 2015 16:06:20 +0100 rneuhauser@suse.cz wrote:
# lukas.ocilka@suse.com / 2015-12-04 13:55:00 +0100:
Hi,
You probably remember that Martin has moved code from installation clients from src/clients to src/lib/installation/clients recently, unfortunately this move has removed all the history from those new files [#1][#2].
I've found a way how to move the content and still keep the history [#3][#4], this is what I did:
1. Moved files from scr/clients to lib/users/clients with `git mv` 2. Pushed this change as a separate commit to my repo 3. Added new clients to scr/clients calling lib/users/clients/* 4. Adapted Makefile.am in src to rake (take) care about libs 5. Pushed again
The trick was to persuade git that I have just moved files from one location to another. I've probably discovered America today, but it still might be helpful to you :)
git does not track moves/renames. unlike some other versioning tools like svn or hg, git does not attach any "identity" to a file.
i don't know what "this move has removed all the history from those new files" means, but it's probably about a github's shortcoming.
Git can recognize it itself, even if not explicitelly tracked. Just try move file and then e.g. git log --follow new_file and you will see history off old file too -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 4.12.2015 16:06, rneuhauser@suse.cz wrote:
The trick was to persuade git that I have just moved files from one location to another. I've probably discovered America today, but it still might be helpful to you :)
git does not track moves/renames. unlike some other versioning tools like svn or hg, git does not attach any "identity" to a file.
This is about moving code from place A to place B. How Martin did it made him author of all the code at place B, which I just did not want. The trick was to do it in more steps.
i don't know what "this move has removed all the history from those new files" means, but it's probably about a github's shortcoming.
Well, hasn't "removed the history", you can still see it, but developers usually try `git blame` to find out who and why did something, so it's not just GitHub. And even if so, we use GitHub, so we somehow have to take that into account anyway. HTH Lukas -- Lukas Ocilka, Systems Management (Yast) Team Leader SLE Department, SUSE Linux -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Fri, 4 Dec 2015 16:21:32 +0100 Lukas Ocilka <lukas.ocilka@suse.com> wrote:
On 4.12.2015 16:06, rneuhauser@suse.cz wrote:
The trick was to persuade git that I have just moved files from one location to another. I've probably discovered America today, but it still might be helpful to you :)
git does not track moves/renames. unlike some other versioning tools like svn or hg, git does not attach any "identity" to a file.
This is about moving code from place A to place B. How Martin did it made him author of all the code at place B, which I just did not want. The trick was to do it in more steps.
i don't know what "this move has removed all the history from those new files" means, but it's probably about a github's shortcoming.
Well, hasn't "removed the history", you can still see it, but developers usually try `git blame` to find out who and why did something, so it's not just GitHub. And even if so, we use GitHub, so we somehow have to take that into account anyway.
git blame also support --follow, so if you need to find who is author of line after move, then simple you can use `git blame --follow <file>`. So Lukas extra step really helps with finding author of line.
HTH Lukas
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (3)
-
Josef Reidinger
-
Lukas Ocilka
-
rneuhauser@suse.cz