อย่างผมนำเอา SVN ไปใช้งานในโปรเจ็ค web app ตัวหนึ่ง ผมอยากทราบว่า เมื่อไร ผมถึงจะใช้ Branches และ Tags นี่คืออะไรครับใช้ในขั้นตอนใหน

เพราะตอนนี้เจอปัญหาคือ ไม่ว่าจะ แก้ไข code หนึ่งบรรทัด เลข version ก็ run ไปได้เรื่อยๆ คืออยากจะทำอย่างสากลเขาทำกันครับ ยังมือใหม่อยู่ครับผม

ขอบคุณครับผม

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

ขอบคุณมากครับสำหรับบทความดีๆ
ผมอ่านแล้วเข้าใจพอสมควรเลยครับ เมื่อไรจะมี บทความของ Git บ้างครับผมรองอ่าน

เรื่องเลข version ที่เห็นใน SVN อย่าไปซีเรียส มันเป็นเหมือน internal sequential number ของ_ทั้ง_ SVN repository

ถ้าใน repository นี้มีหลายโครงการ คุณจะเห็นได้ว่า เลข version นั่น อาจจะกระโดดได้ไกลมาก เพราะว่าโครงการอื่นดันขยัน commit

ถ้าจะเอาเลข build แนะนำให้ทำพวก build script เพื่อดูแลค่า app.build เองจะเหมาะกว่านะครับ

บางคน commit ทุกครั้งที่กดเซฟครับ -*- มันยิ่งทำให้กระจัดกระจายเวลาต้องการเทียบย้อนหลัง เตือนก็ไม่ค่อยฟัง ทำนองว่าเลขยิ่งรันเยอะ = ยิ่งขยัน

จริงๆคอมมิทบ่อยๆทุกครั้งที่เซฟก็ไม่เป็นอะไรนะครับ ขอให้เขียนคอมเมนท์กำกับทุกครั้งเพื่อที่จะได้ไล่อ่านได้สะดวกๆ

จะตั้งไว้ว่าถ้าไม่มีคอมเมนท์ก็ห้ามคอมมิทก็ได้

kowito2 Wed, 21/10/2009 - 21:12

In reply to by crucifier

ผมถือคติ เซฟทุกครั้งที่ยกมือขึ้นจากคีย์บอร์ด และ commit ทุกครั้งที่จบหนึ่งฟังชั่น หรือ 15 นาที แล้วแต่ว่าอันใหนมาก่อน และ comment ทุกครั้งที่ commit จะได้รู้ว่าเกิดอะไรขึ้นบ้าง มันจะส่งผลดีกับทีมโดยรวม

ออกตัวก่อนนะครับผมก็ไม่เก่งเรื่อง subversion เท่าไร ขอให้ท่านผู้รู้ช่วยเสริมด้วยนะครับ

ใน svn เราสร้าง project ไว้ใช่ไหมครับ

  • project/trunk << หมายถึง ถังความคิดหรือสิ่งใหม่ๆ เวลาเราพัฒนา project เราจะทำงานที่ นี้เป็นหลัก
  • project/branches << หมายถึง สาขาที่เราแตกออกมาจากตัว trunk เมืองานเราทำมาได้สักระยะ อยากจะลองปล่อยใช้ เราก็จะแตกสาขาออกมา เวลาเราปล่อยใช้แล้วเจอ Bug เราจะมาแก้ไขที่นี้เป็นหลัก จากนั้นก็จะ merge ลงไปที่ trunk เพื่อแก้บักไปด้วย (อาจจะงง)
  • project/tags << หมายถึง ป้ายเราจะแปะไว้ เช่นงานที่เราปล่อยมาและแก้ไขบักจนเป็นที่พอใจแล้ว เราก็แปะ้ป้ายให้มันว่าเป็น version 1.0.0

ก็อะไรประมาณนี้ครับ แนะนำให้หาหนังสือมาอ่านครับจะเข้าใจมากขึ้น เล่มที่ผมอ่านก็ Pragmatic Version Control Using Subversion โดย Mike Mason ครับ

ต้องถือนโยบายนี้ก่อนครับ จะไม่มีที่เก็บ source code อื่นใด นอกไปจาก working copy และ SVN

ไม่มีแอบไป zip/rar แอบไป .org แอบไป .bak

Trunk นี่สายหลัก

Branches นี่มีผมใช้สองแบบ Maintenance/Bug fix ประเภท พิมพ์โน่นตก คำนวณผิด อัพเดทพลาด กับ Feature เช่นเพิ่ม flow แบบใหม่ ทั้งสองแบบไม่ใช่ถาวร พอเสถียรค่อย merge กลับเข้าสายหลัก

เพื่อที่ให้การพัฒนาฟีเจอร์ใหม่ กับ แก้บั๊กสามารถทำคู่ขนานกันไปได้ โดยที่ไม่มีผลกระทบกับอีกสายหนึ่ง อันนี้อธิบายเป็นคำพูดลำบาก ต้องให้เห็นภาพ แต่เป็นความคิดที่ยอดมาก (จะไปลำบาก ก็ตอน merge กันนี่แหล่ะ)

ส่วน Tag นี่เหมือนทำ snapshot ไว้ครับ เพราะว่าแอพพลิเคชันแต่ละตัว จะประกอบด้วยหลายไฟล์ เวอร์ชันแต่ละตัวก็ไม่เท่ากัน บางตัวหนึ่ง บางตัวหกสิบ แต่เรามัดรวมว่านี่ สายนี้เรียกว่า 1.0

ประโยชน์ที่ผมใช้ คือไว้ตอน milestone ใหญ่ เช่น ไว้ตอนที่ส่งให้ UAT/SIT ผมจะ tags จาก branch ลงมาไว้เป็นแบบ UAT-1 หรือ 1.0.20091003-08 (ชอบแบบหลังมากกว่า เพราะจะได้ไม่รู้ว่า UAT มากี่รอบแล้วววว) เหมือนทำ snapshot ไว้ โดยที่ไม่ต้องมานั่งพะวงเก็บ source ไว้แยกต่างหาก เดียวงง ก็แค่ tag แล้ว checkout ออกมา build

อย่าลืมให้แอพพลิเคชัน ต้องแสดงค่า version กับ build มาด้วย อาจจะหน้า login หรือที่ footer สุดแท้แต่

เพราะว่าเวลาลูกค้าเอาไปทำที่ UAT แล้วมีปัญหา ถ้าเค้า capture จอภาพที่ ระบุ build number ได้ เราจะได้เอาชุดนั้น snapshot นั้นมา ง่ายๆ