mirror of
				https://github.com/kastdeur/pipeband-music.git
				synced 2025-10-31 02:16:34 +01:00 
			
		
		
		
	Makefile: add gitmtime to a file's git commit time
This commit is contained in:
		
							parent
							
								
									321a31e879
								
							
						
					
					
						commit
						0480958ea1
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		
							
								
								
									
										10
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile
									
										
									
									
									
								
							|  | @ -58,3 +58,13 @@ SUBDIRS := $(sort $(SUBDIRS)) | |||
| .PHONY: $(SUBDIRS) | ||||
| $(SUBDIRS) : % : | ||||
| 	@$(MAKE) $(filter $(@D)/%.pdf,$(PDFOBJS)) | ||||
| 
 | ||||
| # Special target for setting modification times back to commit time
 | ||||
| .PHONY: gitmtime | ||||
| gitmtime: | ||||
| 	@# From https://stackoverflow.com/a/30143117 | ||||
| 	for FILE in $$(git ls-files); do \
 | ||||
| 	    TIME=$$(git log --pretty=format:%cd -n 1 --date=iso $$FILE); \
 | ||||
| 	    TIME2=$$(echo $$TIME | sed 's/-//g;s/ //;s/://;s/:/\./;s/ .*//'); \
 | ||||
| 	    touch -m -t $$TIME2 $$FILE; \
 | ||||
| 	done | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue