What have you found for these years?

2008-06-12

git 很好很強大...

(前情提要:我把某一段程式碼,從一個檔案 cut 下來,paste 到另一檔案)

雖然剛剛看了 redmine 的 svn diff,
好像也會顯示不同檔案間程式碼的移動?
不過看起來就怪怪的,如果我不知道他是移動的話,
應該會看不懂才對,因為沒什麼說明,
而且變成兩個不同的檔案在做 diff @@

但是在 git commit -a 時,看到神奇的訊息,讓我吃了 LCD:

* added app_ext for AbstractRequest patch, which extracted from photos/upload.rb
for ActiveRecord::Base.exists_and_find

# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# renamed: lib/ffbapi/photos/upload.rb -> config/initializers/app_ext.rb
# modified: lib/ffbapi/photos/upload.rb


噢,他居然知道我程式碼是從 upload.rb 移動到 app_ext.rb @_@

commit 完之後的訊息是:

godfat ~/p/g/photo_app> git commit -a
Created commit 183997a: * added app_ext for AbstractRequest patch,
which extracted from photos/upload.rb
2 files changed, 22 insertions(+), 151 deletions(-)
rename lib/ffbapi/photos/upload.rb => config/initializers/app_ext.rb (90%)
rewrite lib/ffbapi/photos/upload.rb (90%)
godfat ~/p/g/photo_app>


他知道移動了 90% 的 code @_@
雖然說 rename 這個詞似乎有點不直接就是了...

上傳:

godfat ~/p/g/photo_app> git svn dcommit
Committing to svn+ssh://svn.roodo.com/var/svn/photo_app ...
Password:
C lib/ffbapi/photos/upload.rb => config/initializers/app_ext.rb
M lib/ffbapi/photos/upload.rb
Committed r504
A config/initializers/app_ext.rb
M lib/ffbapi/photos/upload.rb
r504 = aa436378cba9d0fad39780a98b29995ae9e74951 (git-svn)
No changes between current HEAD and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn


為什麼是 C 啊 @_@ 看起來不是 conflict 的意思...
總覺得應該再多看一點 git 的概念的,可惜一直沒仔細讀過。

gitk 裡則這樣顯示:

---------- config/initializers/app_ext.rb ----------
similarity index 90%
copy from lib/ffbapi/photos/upload.rb
copy to config/initializers/app_ext.rb
index cd39bc4..1ec4ac3 100644

這就非常容易看懂了 XDD

6 retries:

Plumm said...

LCD 怎咩吃??

Lin Jen-Shin (godfat) said...

翻譯成中文:吃液晶 => 吃一驚

Hinoris said...

真是冷到爆了= =

Lin Jen-Shin (godfat) said...

夏天到了,要一點涼意才舒服啊 XD

Plumm said...

http://www.gameguides.ws/

這裡可以看到 MetaPhysicist 的 Guide :QQ

Lin Jen-Shin (godfat) said...

網站沒有回應

Post a Comment

Note: Only a member of this blog may post a comment.



All texts are licensed under CC Attribution 3.0