Permalink
Commits on Apr 4, 2006
  1. Use sigaction and SA_RESTART in read-tree.c; add option in Makefile.

    Might as well ape the sigaction change in read-tree.c to avoid
    the same potential problems.  The fprintf status output will
    be overwritten in a second, so don't bother guarding it.  Do
    move the fputc after disabling SIGALRM to ensure we go to the
    next line, though.
    
    Also add a NO_SA_RESTART option in the Makefile in case someone
    doesn't have SA_RESTART but does restart (maybe older HP/UX?).
    We want the builder to chose this specifically in case the
    system both lacks SA_RESTART and does not restart stdio calls;
    a compat #define in git-compat-utils.h would silently allow
    broken systems.
    
    Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Jason Riedy committed with Junio C Hamano Apr 2, 2006
  2. safe_fgets() - even more anal fgets()

    This is from Linus -- the previous round forgot to clear error
    after EINTR case.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Apr 4, 2006
Commits on Apr 2, 2006
  1. pack-objects: be incredibly anal about stdio semantics

    This is the "letter of the law" version of using fgets() properly in the
    face of incredibly broken stdio implementations.  We can work around the
    Solaris breakage with SA_RESTART, but in case anybody else is ever that
    stupid, here's the "safe" (read: "insanely anal") way to use fgets.
    
    It probably goes without saying that I'm not terribly impressed by
    Solaris libc.
    
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Linus Torvalds committed with Junio C Hamano Apr 2, 2006
  2. Fix Solaris stdio signal handling stupidities

    This uses sigaction() to install the SIGALRM handler with SA_RESTART, so
    that Solaris stdio doesn't break completely when a signal interrupts a
    read.
    
    Thanks to Jason Riedy for confirming the silly Solaris signal behaviour.
    
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Linus Torvalds committed with Junio C Hamano Apr 2, 2006
Commits on Mar 4, 2006
  1. tar-tree: file/dirmode fix.

    This fixes two bugs introduced when we switched to generic tree
    traversal code.
    
     (1) directory mode recorded silently became 0755, not 0777
    
     (2) if passed a tree object (not a commit), it emitted an
         alarming error message (but proceeded anyway).
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Mar 4, 2006
Commits on Mar 2, 2006
  1. read-tree --aggressive: remove deleted entry from the working tree.

    When both heads deleted, or our side deleted while the other
    side did not touch, we did not have to update the working tree.
    
    However, we forgot to remove existing working tree file when we
    did not touch and the other side did.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Mar 2, 2006
  2. Merge branch 'lt/fix-apply' into maint

    * lt/fix-apply:
      git-am: --whitespace=x option.
      git-apply: war on whitespace -- finishing touches.
      git-apply --whitespace=nowarn
      apply --whitespace: configuration option.
      apply: squelch excessive errors and --whitespace=error-all
      apply --whitespace fixes and enhancements.
      The war on trailing whitespace
    Junio C Hamano committed Mar 2, 2006
Commits on Mar 1, 2006
  1. git-mv: fixes for path handling

    Moving a directory ending in a slash was not working as the
    destination was not calculated correctly.
    E.g. in the git repo,
    
     git-mv t/ Documentation
    
    gave the error
    
     Error: destination 'Documentation' already exists
    
    To get rid of this problem, strip trailing slashes from all arguments.
    The comment in cg-mv made me curious about this issue; Pasky, thanks!
    As result, the workaround in cg-mv is not needed any more.
    
    Also, another bug was shown by cg-mv. When moving files outside of
    a subdirectory, it typically calls git-mv with something like
    
     git-mv Documentation/git.txt Documentation/../git-mv.txt
    
    which triggers the following error from git-update-index:
    
     Ignoring path Documentation/../git-mv.txt
    
    The result is a moved file, removed from git revisioning, but not
    added again. To fix this, the paths have to be normalized not have ".."
    in the middle. This was already done in git-mv, but only for
    a better visual appearance :(
    
    Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    weidendo committed with Junio C Hamano Mar 1, 2006
  2. git-mv: Allow -h without repo & fix error message

    This fixes "git-mv -h" to output the usage without the need
    to be in a git repository.
    Additionally:
    - fix confusing error message when only one arg was given
    - fix typo in error message
    
    Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    weidendo committed with Junio C Hamano Mar 1, 2006
  3. Allow git-mv to accept ./ in paths.

    Signed-off-by: Junio C Hamano <junkio@cox.net>
    (cherry picked from 9a0e673 commit)
    Junio C Hamano committed Feb 19, 2006
  4. combine-diff: Honour -z option correctly.

    Combined diffs don't null terminate things in the same way as standard
    diffs.  This is presumably wrong.
    
    Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    (cherry picked from 6baf048 commit)
    distorted-mdw committed with Junio C Hamano Feb 27, 2006
  5. combine-diff: Honour --full-index.

    For some reason, combined diffs don't honour the --full-index flag when
    emitting patches.  Fix this.
    
    Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    (cherry picked from e70c6b3 commit)
    distorted-mdw committed with Junio C Hamano Feb 27, 2006
  6. diffcore-break: micro-optimize by avoiding delta between identical fi…

    …les.
    
    We did not check if we have the same file on both sides when
    computing break score.  This is usually not a problem, but if
    the user said --find-copies-harde with -B, we ended up trying a
    delta between the same data even when we know the SHA1 hash of
    both sides match.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    (cherry picked from aeecd23 commit)
    Junio C Hamano committed Mar 1, 2006
  7. git-am: --whitespace=x option.

    This is passed down to git-apply to override the built-in
    default and per-repository configuration at runtime.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Mar 1, 2006
Commits on Feb 28, 2006
  1. git-apply: war on whitespace -- finishing touches.

    This changes the default --whitespace policy to nowarn when we
    are only getting --stat, --summary etc. IOW when not applying
    the patch.  When applying the patch, the default is warn (spit
    out warning message but apply the patch).
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 28, 2006
  2. git-apply --whitespace=nowarn

    Andrew insists --whitespace=warn should be the default, and I
    tend to agree.  This introduces --whitespace=warn, so if your
    project policy is more lenient, you can squelch them by having
    apply.whitespace=nowarn in your configuration file.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 28, 2006
  3. apply --whitespace: configuration option.

    The new configuration option apply.whitespace can take one of
    "warn", "error", "error-all", or "strip".  When git-apply is run
    to apply the patch to the index, they are used as the default
    value if there is no command line --whitespace option.
    
    Andrew can now tell people who feed him git trees to update to
    this version and say:
    
    	git repo-config apply.whitespace error
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 27, 2006
  4. apply: squelch excessive errors and --whitespace=error-all

    This by default makes --whitespace=warn, error, and strip to
    warn only the first 5 additions of trailing whitespaces.  A new
    option --whitespace=error-all can be used to view all of them
    before applying.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 27, 2006
  5. apply --whitespace fixes and enhancements.

    In addition to fixing obvious command line parsing bugs in the
    previous round, this changes the following:
    
     * Adds "--whitespace=strip".  This applies after stripping the
       new trailing whitespaces introduced to the patch.
    
     * The output error message format is changed to say
       "patch-filename:linenumber:contents of the line".  This makes
       it similar to typical compiler error message format, and
       helps C-x ` (next-error) in Emacs compilation buffer.
    
     * --whitespace=error and --whitespace=warn do not stop at the
       first error.  We might want to limit the output to say first
       20 such lines to prevent cluttering, but on the other hand if
       you are willing to hand-fix after inspecting them, getting
       everything with a single run might be easier to work with.
       After all, somebody has to do the clean-up work somewhere.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 27, 2006
  6. The war on trailing whitespace

    On Sat, 25 Feb 2006, Andrew Morton wrote:
    >
    > I'd suggest a) git will simply refuse to apply such a patch unless given a
    > special `forcing' flag, b) even when thus forced, it will still warn and c)
    > with a different flag, it will strip-then-apply, without generating a
    > warning.
    
    This doesn't do the "strip-then-apply" thing, but it allows you to make
    git-apply generate a warning or error on extraneous whitespace.
    
    Use --whitespace=warn to warn, and (surprise, surprise) --whitespace=error
    to make it a fatal error to have whitespace at the end.
    
    Totally untested, of course. But it compiles, so it must be fine.
    
    HOWEVER! Note that this literally will check every single patch-line with
    "+" at the beginning. Which means that if you fix a simple typo, and the
    line had a space at the end before, and you didn't remove it, that's still
    considered a "new line with whitespace at the end", even though obviously
    the line wasn't really new.
    
    I assume this is what you wanted, and there isn't really any sane
    alternatives (you could make the warning activate only for _pure_
    additions with no deletions at all in that hunk, but that sounds a bit
    insane).
    
    		Linus
    Linus Torvalds committed with Junio C Hamano Feb 26, 2006
Commits on Feb 26, 2006
  1. sample hooks template.

    These two sample hooks try to detect and use the corresponding
    commit hook from the same repository.  However, they forgot to
    set up GIT_DIR for their own use, so was not in effect.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 26, 2006
Commits on Feb 24, 2006
  1. Merge branch 'fix' into maint

    * fix:
      git-am: do not allow empty commits by mistake.
    Junio C Hamano committed Feb 24, 2006
  2. Merge branches 'jc/fix-co-candy', 'jc/fix-rename-leak' and 'ar/fix-wi…

    …n' into maint
    
    * jc/fix-co-candy:
      checkout - eye candy.
    
    * jc/fix-rename-leak:
      diffcore-rename: plug memory leak.
    
    * ar/fix-win:
      fix t5600-clone-fail-cleanup.sh on windows
    Junio C Hamano committed Feb 24, 2006
  3. git-am: do not allow empty commits by mistake.

    Running "git-am --resolved" without doing anything can create an empty
    commit. Prevent it.
    
    Thanks for Eric W. Biederman for spotting this.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 24, 2006
Commits on Feb 23, 2006
  1. fix t5600-clone-fail-cleanup.sh on windows

    In windows you cannot remove current or opened directory,
    an opened file, a running program, a loaded library, etc...
    
    [jc: signoffs?  With a minor quoting fix.]
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    raalkml committed with Junio C Hamano Feb 23, 2006
  2. diffcore-rename: plug memory leak.

    Spotted by Nicolas Pitre.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 23, 2006
  3. Give no terminating LF to error() function.

    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 23, 2006
  4. checkout - eye candy.

    This implements "eye candy" similar to the pack-object/unpack-object
    to entertain users while a large tree is being checked out after
    a clone or a pull.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 23, 2006
  5. git-fetch: follow tag only when tracking remote branch.

    Unless --no-tags flag was given, git-fetch tried to always
    follow remote tags that point at the commits we picked up.
    
    It is not very useful to pick up tags from remote unless storing
    the fetched branch head in a local tracking branch.  This is
    especially true if the fetch is done to merge the remote branch
    into our current branch as one-shot basis (i.e. "please pull"),
    and is even harmful if the remote repository has many irrelevant
    tags.
    
    This proposed update disables the automated tag following unless
    we are storing the a fetched branch head in a local tracking
    branch.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 22, 2006
  6. pack-objects eye-candy: finishing touches.

    This updates the progress output to match "every one second or
    every percent whichever comes early" used by unpack-objects, as
    discussed on the list.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 23, 2006
Commits on Feb 22, 2006
  1. also adds progress when actually writing a pack

    If that pack is big, it takes significant time to write and might
    benefit from some more eye candies as well.  This is however disabled
    when the pack is written to stdout since in that case the output is
    usually piped into unpack_objects which already does its own progress
    reporting.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Nicolas Pitre committed with Junio C Hamano Feb 22, 2006
  2. nicer eye candies for pack-objects

    This provides a stable and simpler progress reporting mechanism that
    updates progress as often as possible but accurately not updating more
    than once a second.  The deltification phase is also made more
    interesting to watch (since repacking a big repository and only seeing a
    dot appear once every many seconds is rather boring and doesn't provide
    much food for anticipation).
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Nicolas Pitre committed with Junio C Hamano Feb 22, 2006
  3. Keep Porcelainish from failing by broken ident after making changes.

    "empty ident not allowed" error makes commit-tree fail, so we
    are already safer in that we would not end up with commit
    objects that have bogus names on the author or committer fields.
    However, before commit-tree is called there are already changes
    made to the index file and the working tree.  The operation can
    be resumed after fixing the environment problem, but when this
    triggers to a newcomer with unusable gecos, the first question
    becomes "what did I lose and how would I recover".
    
    This patch modifies some Porcelainish commands to verify
    GIT_COMMITTER_IDENT as soon as we know we are going to make some
    commits before doing much damage to prevent confusion.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 19, 2006
  4. Delay "empty ident" errors until they really matter.

    Previous one warned people upfront to encourage fixing their
    environment early, but some people just use repositories and git
    tools read-only without making any changes, and in such a case
    there is not much point insisting on them having a usable ident.
    
    This round attempts to move the error until either "git-var"
    asks for the ident explicitly or "commit-tree" wants to use it.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 19, 2006
  5. Make "empty ident" error message a bit more helpful.

    It appears that some people who did not care about having bogus
    names in their own commit messages are bitten by the recent
    change to require a sane environment [*1*].
    
    While it was a good idea to prevent people from using bogus
    names to create commits and doing sign-offs, the error message
    is not very informative.  This patch attempts to warn things
    upfront and hint people how to fix their environments.
    
    [Footnote]
    
    *1* The thread is this one.
    
        http://marc.theaimsgroup.com/?t=113868084800004
    
        Especially this message.
    
        http://marc.theaimsgroup.com/?m=113932830015032
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano committed Feb 18, 2006