@@ -94,7 +94,6 @@ func main() {
9494 flag .Usage ()
9595 os .Exit (1 )
9696 }
97- log .Println ("Successfully carved out module. Changes are ready to be pushed." )
9897}
9998
10099func (c * carver ) Run () error {
@@ -304,6 +303,7 @@ func (c *carver) CreateGitTags(rootMod *modInfo) error {
304303 return err
305304 }
306305 childPrefix := strings .TrimPrefix (strings .TrimPrefix (c .childModPath , rootMod .filePath ), "/" )
306+ childModTag := fmt .Sprintf ("%s/%s" , childPrefix , c .childTagVersion )
307307 log .Println ("Commiting changes" )
308308 if ! c .dryRun {
309309 cmd := exec .Command ("git" , "add" , "-A" )
@@ -312,28 +312,18 @@ func (c *carver) CreateGitTags(rootMod *modInfo) error {
312312 return fmt .Errorf ("unable to add changes: %s" , b )
313313 }
314314 cmd = exec .Command ("git" , "commit" , "-m" ,
315- fmt .Sprintf ("chore(%s): carve out sub-module" , childPrefix ))
315+ fmt .Sprintf ("chore(%s): carve out sub-module\n \n This commit will be tagged %s and %s. " , childPrefix , futureTag , childModTag ))
316316 cmd .Dir = c .parentModPath
317317 if b , err := cmd .Output (); err != nil {
318318 return fmt .Errorf ("unable to commit changes: %s" , b )
319319 }
320320 }
321- log .Printf ("Tagging Root module: %s" , futureTag )
322- if ! c .dryRun {
323- cmd := exec .Command ("git" , "tag" , futureTag )
324- cmd .Dir = c .parentModPath
325- if b , err := cmd .Output (); err != nil {
326- return fmt .Errorf ("unable to tag root module: %s" , b )
327- }
328- }
329- log .Printf ("Tagging Child module: %s/%s" , childPrefix , c .childTagVersion )
330- if ! c .dryRun {
331- cmd := exec .Command ("git" , "tag" , fmt .Sprintf ("%s/%s" , childPrefix , c .childTagVersion ))
332- cmd .Dir = c .parentModPath
333- if b , err := cmd .Output (); err != nil {
334- return fmt .Errorf ("unable to tag child module: %s" , b )
335- }
336- }
321+ log .Println ("Successfully carved out module. Please run the following commands after your change is merged:" )
322+ fmt .Fprintf (os .Stdout , "git tag -a %s <COMMIT-SHA>\n " , futureTag )
323+ fmt .Fprintf (os .Stdout , "git tag -a %s <COMMIT-SHA>\n " , childModTag )
324+ fmt .Fprintf (os .Stdout , "git push origin ref/tags/%s\n " , futureTag )
325+ fmt .Fprintf (os .Stdout , "git push origin ref/tags/%s\n " , childModTag )
326+
337327 return nil
338328}
339329
0 commit comments