git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-ls-new-files & make patch, pull, etc.

From
JCJeff Carr <jcarr@linuxmachines.com>
Date
Aug 23, 2005, 02:07 UTC
Message-ID
<430A84D1.2050206@linuxmachines.com>

Something simple like the perl script at the bottom would be useful for showing files that haven't been added via git-update-cache --add already.

I've also found it useful to start adding things to the Makefile's of the projects I'm putting in git repositories. I think it would be useful to come up with some standard or recommended names. That could start to extend the common "make" "make install" with a few other options for projects that use git as their SCM.

Thanks, Jeff

patch:
	git-diff-files -p
push:
	git-send-pack `cat .git/branches/origin`
pull:
	git-pull-script `cat .git/branches/origin`
	git-read-tree -m HEAD
	git-checkout-cache -q -f -u -a
commit:
	vi changelog.txt
	GIT_AUTHOR_NAME="$(GIT_AUTHOR_NAME)" \
	GIT_AUTHOR_EMAIL="$(GIT_AUTHOR_EMAIL)" \
	git-commit-tree `git-write-tree` -p $(HEAD) < changelog.txt > .git/HEAD
	rm changelog.txt
add_all:
	./git-ls-new-files |xargs -n 1 git-update-cache --add
#!/usr/bin/perl
# Shows you what files have not been added to your git repository
my %allfiles;
# make a hash of all the files except the .git/ directory
foreach my $file ( `find . -type f` ) {
	chomp $file;
	next if substr($file, 0, 7) eq "./.git/";
	$allfiles{ $file } = "";
}
# now delete all the files from the hash that are already commited
foreach my $file ( split "\n", `git-ls-files` ) {
	chomp $file;
	delete $allfiles{ "./$file" };
}
# print out what's left
foreach my $file ( sort keys %allfiles ) {
	print "$file\n";
}
Next: Junio C Hamano
Message 1 of 8 in “git-ls-new-files & make patch, pull, etc.”
  1. Jeff CarrAug 23, 2005
  2. Junio C HamanoAug 23, 2005
  3. Jeff CarrSep 6, 2005
  4. Junio C HamanoSep 6, 2005
  5. Jeff CarrSep 8, 2005
  6. Junio C HamanoSep 9, 2005
  7. Johannes SchindelinAug 23, 2005
  8. Jeff CarrSep 6, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.