 8922506cb2
			
		
	
	8922506cb2
	
	
	
		
			
			The "howto-index.sh" is used to generate an index of our how-to docs. It receives as input the paths to these documents, which would typically be relative to the "Documentation/" directory in Makefile-based builds. In an out-of-tree build though it will get relative that may be rooted somewhere else entirely. The file paths do end up in the generated index, and the expectation is that they should always start with "howto/". But for out-of-tree builds we would populate it with the paths relative to the build directory, which is wrong. Fix the issue by using `$(basename "$file")` to generate the path. While at it, move the script into "howto/" to align it with the location of the comparable "api-index.sh" script. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
		
			
				
	
	
		
			57 lines
		
	
	
		
			693 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			693 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| cat <<\EOF
 | |
| Git Howto Index
 | |
| ===============
 | |
| 
 | |
| Here is a collection of mailing list postings made by various
 | |
| people describing how they use Git in their workflow.
 | |
| 
 | |
| EOF
 | |
| 
 | |
| for txt
 | |
| do
 | |
| 	title=$(expr "$txt" : '.*/\(.*\)\.txt$')
 | |
| 	from=$(sed -ne '
 | |
| 	/^$/q
 | |
| 	/^From:[ 	]/{
 | |
| 		s///
 | |
| 		s/^[ 	]*//
 | |
| 		s/[ 	]*$//
 | |
| 		s/^/by /
 | |
| 		p
 | |
| 	}
 | |
| 	' "$txt")
 | |
| 
 | |
| 	abstract=$(sed -ne '
 | |
| 	/^Abstract:[ 	]/{
 | |
| 		s/^[^ 	]*//
 | |
| 		x
 | |
| 		s/.*//
 | |
| 		x
 | |
| 		: again
 | |
| 		/^[ 	]/{
 | |
| 			s/^[ 	]*//
 | |
| 			H
 | |
| 			n
 | |
| 			b again
 | |
| 		}
 | |
| 		x
 | |
| 		p
 | |
| 		q
 | |
| 	}' "$txt")
 | |
| 
 | |
| 	if grep 'Content-type: text/asciidoc' >/dev/null $txt
 | |
| 	then
 | |
| 		file=$(expr "$txt" : '\(.*\)\.txt$').html
 | |
| 	else
 | |
| 		file="$txt"
 | |
| 	fi
 | |
| 
 | |
| 	echo "* link:howto/$(basename "$file")[$title] $from
 | |
| $abstract
 | |
| 
 | |
| "
 | |
| 
 | |
| done
 |