summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2007-11-29per-directory-exclude: lazily read .gitignore filesJunio C Hamano
Operations that walk directories or trees, which potentially need to consult the .gitignore files, used to always try to open the .gitignore file every time they entered a new directory, even when they ended up not needing to call excluded() function to see if a path in the directory is ignored. This was done by push/pop exclude_per_directory() functions that managed the data in a stack. This changes the directory walking API to remove the need to call these two functions. Instead, the directory walk data structure caches the data used by excluded() function the last time, and lazily reuses it as much as possible. Among the data the last check used, the ones from deeper directories that the path we are checking is outside are discarded, data from the common leading directories are reused, and then the directories between the common directory and the directory the path being checked is in are checked for .gitignore file. This is very similar to the way gitattributes are handled. This API change also fixes "ls-files -c -i", which called excluded() without setting up the gitignore data via the old push/pop functions. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-29dir.c: minor clean-upJunio C Hamano
Replace handcrafted reallocation with ALLOC_GROW(). Reindent "file_exists()" helper function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-29Merge branch 'maint'Junio C Hamano
* maint: scripts: do not get confused with HEAD in work tree Improve description of git-branch -d and -D in man page.
2007-11-29scripts: do not get confused with HEAD in work treeJunio C Hamano
When you have a file called HEAD in your work tree, many commands that our scripts feed "HEAD" to would complain about the rev vs path ambiguity. A solution is to form command line more carefully by appending -- to them, which makes it clear that we mean HEAD rev not HEAD file. This patch would apply to maint. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-29bash completion: add diff optionsJohannes Schindelin
I use "git diff" (the porcelain) really often, and am almost as often annoyed that the completions do not know how to complete something simple as --cached. Now they do. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-29git checkout's reflog: even when detaching the HEAD, say from whereJohannes Schindelin
When checking out another ref, the reflogs already record from which branch you switched. Do that also when switching to a detached HEAD. While at it, record also when coming _from_ a detached HEAD. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-29sha1_file.c: Fix size_t related printf format warningsSteffen Prohaska
The old way of fixing warnings did not succeed on MinGW. MinGW does not support C99 printf format strings for size_t [1]. But gcc on MinGW issues warnings if C99 printf format is not used. Hence, the old stragegy to avoid warnings fails. [1] http://www.mingw.org/MinGWiki/index.php/C99 This commits passes arguments of type size_t through a tiny helper functions that casts to the type expected by the format string. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28Revert "t5516: test update of local refs on push"Jeff King
This reverts commit 09fba7a59d38d1cafaf33eadaf1d409c4113b30c. These tests are superseded by the ones in t5404 (added in 6fa92bf3 and 8736a848), which are more extensive and better organized. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28Improve description of git-branch -d and -D in man page.Jan Hudec
Some users expect that deleting a remote-tracking branch would prevent fetch from creating it again, so be explcit about that it's not the case. Also be a little more explicit about what fully merged means. Signed-off-by: Jan Hudec <bulb@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28filter-branch: fix dirty way to provide the helpers to commit filtersJohannes Schindelin
The helper functions 'map' and 'skip_commit' were provided to commit filters by sourcing filter-branch itself. This was done with a certain environment variable set to indicate that only the functions should be defined, and the script should return then. This was really hacky, and it did not work all that well, since the full path to git-filter-branch was not known at all times. Avoid that by putting the functions into a variable, and eval'ing that variable. The commit filter gets these functions by prepending the variable to the specified commands. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28git-stash: do not get fooled with "color.diff = true"Pascal Obry
When colors are set to "true" on the repository, the git log output will contain control characters to set/reset the colors, even when the output is to a pipe. This makes list_stash() fail as the downstream sed does not see what it is expecting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-26Use is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.cSteffen Prohaska
Using the helper function to test for absolute paths makes porting easier. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-26Fix typo in draft 1.5.4 release notesWincent Colaiuta
Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-26Merge branch 'maint'Junio C Hamano
* maint: user-manual: recovering from corruption user-manual: clarify language about "modifying" old commits user-manual: failed push to public repository user-manual: define "branch" and "working tree" at start git-checkout: describe detached head correctly
2007-11-26Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maintJunio C Hamano
* 'maint' of git://linux-nfs.org/~bfields/git: user-manual: recovering from corruption user-manual: clarify language about "modifying" old commits user-manual: failed push to public repository user-manual: define "branch" and "working tree" at start
2007-11-26user-manual: recovering from corruptionJ. Bruce Fields
Some instructions on dealing with corruption of the object database. Most of this text is from an example by Linus, identified by Nicolas Pitre <nico@cam.org> with a little further editing by me. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-11-26Print the real filename that we failed to open.André Goddard Rosa
When we fail to open a temporary file to be renamed to something else, we reported the final filename, not the temporary file we failed to open. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-26user-manual: clarify language about "modifying" old commitsJ. Bruce Fields
It's important to remember that git doesn't really allowing "editing" or "modifying" commits, only replacing them by new commits. Redo some of the language to make this clearer. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-11-25revert/cherry-pick: do not mention the original refJunio C Hamano
When you cherry-pick or revert a commit, naming it with an annotated tag, we added a comment, attempting to repeat what we got from the end user, to the message. But this was inconsistent. When we got "cherry-pick branch", we recorded the object name (40-letter SHA-1) without saying anything like "original was 'branch'". There was no need to. Also recent rewrite to use parse-options made it impossible to parrot the original command line without "unparsing". This removes the code that implements the misguided "we dereferenced the tag so record that in the commit message" behaviour. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-25user-manual: failed push to public repositoryJ. Bruce Fields
More details on the case of a failed push to a public (non-shared) repository. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-11-25user-manual: define "branch" and "working tree" at startJ. Bruce Fields
Some explanation here might help. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-11-25git-checkout: describe detached head correctlyJunio C Hamano
When you have a file called HEAD in the work tree, the code to report where the HEAD is at when "git checkout $commit^0" is done triggered unnecessary ambiguity checking. Explicitly mark the command line with "--" and make it clear that we are talking about a revision. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-25Update draft release notes for 1.5.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-25Merge branch 'maint'Junio C Hamano
* maint: Fix rev-list when showing objects involving submodules test format-patch -s: make sure MIME content type is shown as needed format-patch -s: add MIME encoding header if signer's name requires so
2007-11-25Merge branch 'rv/maint-index-commit' into maintJunio C Hamano
* rv/maint-index-commit: Make GIT_INDEX_FILE apply to git-commit
2007-11-25Merge branch 'lt/maint-rev-list-gitlink' into maintJunio C Hamano
* lt/maint-rev-list-gitlink: Fix rev-list when showing objects involving submodules
2007-11-25Merge branch 'jc/maint-add-sync-stat' into maintJunio C Hamano
* jc/maint-add-sync-stat: t2200: test more cases of "add -u" git-add: make the entry stat-clean after re-adding the same contents ce_match_stat, run_diff_files: use symbolic constants for readability
2007-11-25Merge branch 'jc/maint-format-patch-encoding' into maintJunio C Hamano
* jc/maint-format-patch-encoding: test format-patch -s: make sure MIME content type is shown as needed format-patch -s: add MIME encoding header if signer's name requires so
2007-11-25Merge branch 'bs/maint-t7005' into maintJunio C Hamano
* bs/maint-t7005: t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH
2007-11-25Merge branch 'bs/maint-commit-options' into maintJunio C Hamano
* bs/maint-commit-options: git-commit: Add tests for invalid usage of -a/--interactive with paths git-commit.sh: Fix usage checks regarding paths given when they do not make sense
2007-11-25Deprecate peek-remoteJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-25t4119: correct overeager war-on-whitespaceJunio C Hamano
Earlier a6080a0a44d5ead84db3dabbbc80e82df838533d (War on whitespace) dropped a necessary trailing whitespace from the test vector.
2007-11-25Merge branch 'jk/send-pack'Junio C Hamano
* jk/send-pack: (24 commits) send-pack: cluster ref status reporting send-pack: fix "everything up-to-date" message send-pack: tighten remote error reporting make "find_ref_by_name" a public function Fix warning about bitfield in struct ref send-pack: assign remote errors to each ref send-pack: check ref->status before updating tracking refs send-pack: track errors for each ref git-push: add documentation for the newly added --mirror mode Add tests for git push'es mirror mode Update the tracking references only if they were succesfully updated on remote Add a test checking if send-pack updated local tracking branches correctly git-push: plumb in --mirror mode Teach send-pack a mirror mode send-pack: segfault fix on forced push Reteach builtin-ls-remote to understand remotes send-pack: require --verbose to show update of tracking refs receive-pack: don't mention successful updates more terse push output Build in ls-remote ...
2007-11-25Merge branch 'sb/clean'Junio C Hamano
* sb/clean: Teach git clean to use setup_standard_excludes() git-clean: Fix error message if clean.requireForce is not set. Make git-clean a builtin
2007-11-25Merge branch 'js/mingw-fallouts'Junio C Hamano
* js/mingw-fallouts: fetch-pack: Prepare for a side-band demultiplexer in a thread. rehabilitate some t5302 tests on 32-bit off_t machines Allow ETC_GITCONFIG to be a relative path. Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG. Allow a relative builtin template directory. Close files opened by lock_file() before unlinking. builtin run_command: do not exit with -1. Move #include <sys/select.h> and <sys/ioctl.h> to git-compat-util.h. Use is_absolute_path() in sha1_file.c. Skip t3902-quoted.sh if the file system does not support funny names. t5302-pack-index: Skip tests of 64-bit offsets if necessary. t7501-commit.sh: Not all seds understand option -i t5300-pack-object.sh: Split the big verify-pack test into smaller parts.
2007-11-25Merge branch 'mh/rebase-skip-hard'Junio C Hamano
* mh/rebase-skip-hard: Do git reset --hard HEAD when using git rebase --skip
2007-11-25Merge branch 'cc/bisect'Junio C Hamano
* cc/bisect: Bisect reset: do nothing when not bisecting. Bisect: use "$GIT_DIR/BISECT_NAMES" to check if we are bisecting. Bisect visualize: use "for-each-ref" to list all good refs. git-bisect: modernize branch shuffling hack git-bisect: use update-ref to mark good/bad commits git-bisect: war on "sed" Bisect reset: remove bisect refs that may have been packed.
2007-11-23Merge branch 'maint'Junio C Hamano
* maint: Fix sample pre-commit hook
2007-11-23Fix sample pre-commit hookJunio C Hamano
If the worktree happened to have a file called HEAD, "diff-index --cached HEAD" would complain about the ambiguity between revision and path. Avoid it by using an explicit "--" for disambiguation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-23Addendum to "MaintNotes"Junio C Hamano
Add "how to maintain git" document. Foreward by Jeff King. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-23Make test scripts executable.Junio C Hamano
2007-11-23Merge branch 'maint'Junio C Hamano
* maint: Make test scripts executable. bundle create: keep symbolic refs' names instead of resolving them
2007-11-23Make test scripts executable.Junio C Hamano
2007-11-22rebase -i: move help to end of todo fileJohannes Schindelin
[PATCH] rebase -i: move help to end of todo file Many editors start in the first line, so the 9-line help text was an annoyance. So move it to the end. Requested by Junio. While at it, add a hint how to abort the rebase. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-22bundle create: keep symbolic refs' names instead of resolving themJohannes Schindelin
When creating a bundle, symbolic refs used to be resolved to the non-symbolic refs they point to before being written to the list of contained refs. I.e. "git bundle create a1.bundle HEAD master" would show something like 388afe7881b33102fada216dd07806728773c011 refs/heads/master 388afe7881b33102fada216dd07806728773c011 refs/heads/master instead of 388afe7881b33102fada216dd07806728773c011 HEAD 388afe7881b33102fada216dd07806728773c011 refs/heads/master Introduce a special handling so that the symbolic refs are listed with the names passed on the command line. Noticed by Santi Béjar. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-22git-merge-ours: make it a builtin.Thomas Harning
Except that this fixes a longstanding corner case bug by tightening the way underlying diff-index command is run, it is functionally equivalent to the scripted version. Signed-off-by: Thomas Harning Jr <harningt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-22Refactor patch_update_cmdWincent Colaiuta
Split patch_update_cmd into two functions, one to prompt the user for a path to patch and another to do the actual work given that file path. This lays the groundwork for a future commit which will teach git-add--interactive to accept a path parameter and jump directly to the patch subcommand for that path, bypassing the interactive prompt. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-22Authenticate only once in git-send-emailWincent Colaiuta
When using git-send-email with SMTP authentication sending a patch series would redundantly authenticate multiple times, once for each patch. In the worst case, this would actually prevent the series from being sent because the server would reply with a "5.5.0 Already Authenticated" status code which would derail the process. This commit teaches git-send-email to authenticate once and only once at the beginning of the series. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-22Merge git://git.bogomips.org/git-svnJunio C Hamano
* git://git.bogomips.org/git-svn: git-svn: allow `info' command to work offline git-svn: info --url [path] git-svn info: implement info command git-svn: extract reusable code into utility functions t9106: fix a race condition that caused svn to miss modifications
2007-11-22Fix "quote" misconversion for rewrite diff output.Junio C Hamano
663af3422a648e87945e4d8c0cc3e13671f2bbde (Full rework of quote_c_style and write_name_quoted.) mistakenly used puts() when writing out a fixed string when it did not want to add a terminating LF. Signed-off-by: Junio C Hamano <gitster@pobox.com>