- 22 1月, 2009 3 次提交
-
-
由 Jeff King 提交于
If a piece of code wanted to do some cleanup before exiting (e.g., cleaning up a lockfile or a tempfile), our usual strategy was to install a signal handler that did something like this: do_cleanup(); /* actual work */ signal(signo, SIG_DFL); /* restore previous behavior */ raise(signo); /* deliver signal, killing ourselves */ For a single handler, this works fine. However, if we want to clean up two _different_ things, we run into a problem. The most recently installed handler will run, but when it removes itself as a handler, it doesn't put back the first handler. This patch introduces sigchain, a tiny library for handling a stack of signal handlers. You sigchain_push each handler, and use sigchain_pop to restore whoever was before you in the stack. Signed-off-by: NJeff King <peff@peff.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Jeff King 提交于
There are two pieces of code that create tempfiles for diff: run_external_diff and run_textconv. The former cleans up its tempfiles in the face of premature death (i.e., by die() or by signal), but the latter does not. After this patch, they will both use the same cleanup routines. To make clear what the change is, let me first explain what happens now: - run_external_diff uses a static global array of 2 diff_tempfile structs (since it knows it will always need exactly 2 tempfiles). It calls prepare_temp_file (which doesn't know anything about the global array) on each of the structs, creating the tempfiles that need to be cleaned up. It then registers atexit and signal handlers to look through the global array and remove the tempfiles. If it succeeds, it calls the handler manually (which marks the tempfile structs as unused). - textconv has its own tempfile struct, which it allocates using prepare_temp_file and cleans up manually. No signal or atexit handlers. The new code moves the installation of cleanup handlers into the prepare_temp_file function. Which means that that function now has to understand that there is static tempfile storage. So what happens now is: - run_external_diff calls prepare_temp_file - prepare_temp_file calls claim_diff_tempfile, which allocates an unused slot from our global array - prepare_temp_file installs (if they have not already been installed) atexit and signal handlers for cleanup - prepare_temp_file sets up the tempfile as usual - prepare_temp_file returns a pointer to the allocated tempfile The advantage being that run_external_diff no longer has to care about setting up cleanup handlers. Now by virtue of calling prepare_temp_file, run_textconv gets the same benefit, as will any future users of prepare_temp_file. There are also a few side benefits to the specific implementation: - we now install cleanup handlers _before_ allocating the tempfile, closing a race which could leave temp cruft - when allocating a slot in the global array, we will now detect a situation where the old slots were not properly vacated (i.e., somebody forgot to call remove upon leaving the function). In the old code, such a situation would silently overwrite the tempfile names, meaning we would forget to clean them up. The new code dies with a bug warning. - we make sure only to install the signal handler once. This isn't a big deal, since we are just overwriting the old handler, but will become an issue when a later patch converts the code to use sigchain Signed-off-by: NJeff King <peff@peff.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Johannes Sixt 提交于
We had defined some SIG_FOO macros that appear in the code, but that are not supported on Windows, in order to make the code compile. But a subsequent change will assert that a signal number is non-zero. We now use the signal numbers that are commonly used on POSIX systems. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJeff King <peff@peff.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 12 1月, 2009 1 次提交
-
-
由 Jeff King 提交于
We try to keep lines under 80 characters, not to mention that sticking a bunch of stuff on one line makes diffs messier. Signed-off-by: NJeff King <peff@peff.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 11 1月, 2009 4 次提交
-
-
由 Adeodato Simó 提交于
The "--signoff" test case in t7500-commit.sh was setting VISUAL while using -F -, which indeed tested that the editor is not spawned with -F. However, having it there was confusing, since there was no obvious reason to the casual reader for it to be there. This commits removes the setting of VISUAL from the --signoff test, and adds in t7501-commit.sh a dedicated test case, where the rest of tests for -F are. Signed-off-by: NAdeodato Simó <dato@net.com.org.es> Okay-then-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Lee Marlow 提交于
Signed-off-by: NLee Marlow <lee.marlow@gmail.com> Trivially-Acked-by: NShawn O. Pearce <spearce@spearce.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Lee Marlow 提交于
Signed-off-by: NLee Marlow <lee.marlow@gmail.com> Trivially-Acked-by: NShawn O. Pearce <spearce@spearce.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Pierre Habouzit 提交于
git_commit_non_empty_tree is added to the functions that can be run from commit filters. Its effect is to commit only commits actually touching the tree and that are not merge points either. The option --prune-empty is added. It defaults the commit-filter to 'git_commit_non_empty_tree "$@"', and can be used with any other combination of filters, except --commit-hook that must used 'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"' usually to achieve the same result. Signed-off-by: NPierre Habouzit <madcoder@debian.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 07 1月, 2009 14 次提交
-
-
由 Junio C Hamano 提交于
* mh/maint-sendmail-cc-doc: doc/git-send-email: mention sendemail.cc config variable
-
由 Junio C Hamano 提交于
* rs/diff-ihc: diff: add option to show context between close hunks Conflicts: Documentation/diff-options.txt
-
由 Junio C Hamano 提交于
* js/maint-merge-recursive-r-d-conflict: merge-recursive: mark rename/delete conflict as unmerged
-
由 Junio C Hamano 提交于
* mk/gitweb-feature: gitweb: unify boolean feature subroutines
-
由 Junio C Hamano 提交于
* cb/merge-recursive-fix: merge-recursive: do not clobber untracked working tree garbage modify/delete conflict resolution overwrites untracked file
-
由 Junio C Hamano 提交于
* kk/maint-http-push: http-push: support full URI in handle_remote_ls_ctx()
-
由 Junio C Hamano 提交于
* mv/um-pdf: Add support for a pdf version of the user manual
-
由 Junio C Hamano 提交于
* jn/gitweb-blame: gitweb: cache $parent_commit info in git_blame() gitweb: A bit of code cleanup in git_blame() gitweb: Move 'lineno' id from link to row element in git_blame
-
由 Junio C Hamano 提交于
* wp/add-p-goto: Add 'g' command to go to a hunk Add subroutine to display one-line summary of hunks
-
由 René Scharfe 提交于
Make all strbuf functions that can fail free() their memory on error if they have allocated it. They don't shrink buffers that have been grown, though. This allows for easier error handling, as callers only need to call strbuf_release() if A) the command succeeded or B) if they would have had to do so anyway because they added something to the strbuf themselves. Bonus hunk: document strbuf_readlink. Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Junio C Hamano 提交于
* maint: README: tutorial.txt is now called gittutorial.txt
-
由 Junio C Hamano 提交于
* maint-1.6.0: README: tutorial.txt is now called gittutorial.txt
-
由 Junio C Hamano 提交于
* maint-1.5.6: README: tutorial.txt is now called gittutorial.txt
-
由 Joey Hess 提交于
Signed-off-by: NJoey Hess <joey@gnu.kitenet.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 06 1月, 2009 7 次提交
-
-
由 Junio C Hamano 提交于
* maint: Be consistent in switch usage for tar Use capitalized names where appropriate fast-export: print usage when no options specified
-
由 Alexander Potashev 提交于
LF at the end of format strings given to die() is redundant because die already adds one on its own. Signed-off-by: NAlexander Potashev <aspotashev@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Henrik Austad 提交于
tar handles switches with and witout preceding '-', but the documentation should be consistent nonetheless. Signed-off-by: NHenrik Austad <henrik@austad.us> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Henrik Austad 提交于
The Linux kernel and Emacs are both spelled capitalized Signed-off-by: NHenrik Austad <henrik@austad.us> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 SZEDER Gábor 提交于
Signed-off-by: NSZEDER Gábor <szeder@ira.uka.de> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Johannes Schindelin 提交于
We used to extract the tagger information "by hand" in "git show <tag>", but the function pp_user_info() already does that. Even better: it respects the commit_format and date_format specified by the user. Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Giuseppe Bilotta 提交于
Since the OPML project list view was hand-coding the RSS and HTML URLs, it didn't respect global options such as use_pathinfo. Make it use href() to ensure consistency with the rest of the gitweb setup. Signed-off-by: NGiuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: NJakub Narebski <jnareb@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 04 1月, 2009 4 次提交
-
-
由 Miklos Vajna 提交于
Signed-off-by: NMiklos Vajna <vmiklos@frugalware.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Junio C Hamano 提交于
* jc/maint-do-not-switch-to-non-commit: git checkout: do not allow switching to a tree-ish that is not a commit
-
由 Junio C Hamano 提交于
* ap/maint-apply-modefix: builtin-apply: prevent non-explicit permission changes
-
由 Junio C Hamano 提交于
"git checkout -b newbranch $commit^{tree}" mistakenly created a new branch rooted at the current HEAD, because in that case, the two structure fields used to see if the command was invoked without any argument (hence it needs to default to checking out the HEAD) were populated incorrectly. Upon seeing a command line argument that we took as a rev, we should store that string in new.name, even if that does not name a commit. This will correctly trigger the existing safety logic. Signed-off-by: NJunio C Hamano <gitster@pobox.com> Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
-
- 03 1月, 2009 2 次提交
-
-
由 Junio C Hamano 提交于
A git patch that does not change the executable bit records the mode bits on its "index" line. "git apply" used to interpret this mode exactly the same way as it interprets the mode recorded on "new mode" line, as the wish by the patch submitter to set the mode to the one recorded on the line. The reason the mode does not agree between the submitter and the receiver in the first place is because there is _another_ commit that only appears on one side but not the other since their histories diverged, and that commit changes the mode. The patch has "index" line but not "new mode" line because its change is about updating the contents without affecting the mode. The application of such a patch is an explicit wish by the submitter to only cherry-pick the commit that updates the contents without cherry-picking the commit that modifies the mode. Viewed this way, the current behaviour is problematic, even though the command does warn when the mode of the path being patched does not match this mode, and a careful user could detect this inconsistencies between the patch submitter and the patch receiver. This changes the semantics of the mode recorded on the "index" line; instead of interpreting it as the submitter's wish to set the mode to the recorded value, it merely informs what the mode submitter happened to have, and the presense of the "index" line is taken as submitter's wish to keep whatever the mode is on the receiving end. This is based on the patch originally done by Alexander Potashev with a minor fix; the tests are mine. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Johannes Schindelin 提交于
It is not a good practice to prefer performance over readability in something as performance uncritical as finding the trailing slash of argv[0]. So avoid head-scratching by making the loop user-readable, and not hyper-performance-optimized. Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 01 1月, 2009 3 次提交
-
-
由 Junio C Hamano 提交于
* cb/mergetool: mergetool: Don't keep temporary merge files unless told to mergetool: Add prompt to continue after failing to merge a file Add -y/--no-prompt option to mergetool Fix some tab/space inconsistencies in git-mergetool.sh
-
由 Junio C Hamano 提交于
* maint: Documentation/git-tag.txt: minor typo and grammar fix
-
由 jidanni@jidanni.org 提交于
Signed-off-by: Njidanni <jidanni@jidanni.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 29 12月, 2008 2 次提交
-
-
由 Junio C Hamano 提交于
* lt/reset-merge: Document "git-reset --merge" Add 'merge' mode to 'git reset'
-
由 Junio C Hamano 提交于
* np/auto-thread: Force t5302 to use a single thread pack-objects: don't use too many threads with few objects autodetect number of CPUs by default when using threads
-