Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Nov 10, 2009
  1. @jrn @gitster

    Let 'git <command> -h' show usage without a git dir

    jrn authored gitster committed
    There is no need for "git <command> -h" to depend on being inside
    a repository.
    
    Reported by Gerfried Fuchs through http://bugs.debian.org/462557
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 13, 2009
  1. @meyering @gitster

    use write_str_in_full helper to avoid literal string lengths

    meyering authored gitster committed
    In 2d14d65 (Use a clearer style to issue commands to remote helpers,
    2009-09-03) I happened to notice two changes like this:
    
    -	write_in_full(helper->in, "list\n", 5);
    +
    +	strbuf_addstr(&buf, "list\n");
    +	write_in_full(helper->in, buf.buf, buf.len);
    +	strbuf_reset(&buf);
    
    IMHO, it would be better to define a new function,
    
        static inline ssize_t write_str_in_full(int fd, const char *str)
        {
               return write_in_full(fd, str, strlen(str));
        }
    
    and then use it like this:
    
    -       strbuf_addstr(&buf, "list\n");
    -       write_in_full(helper->in, buf.buf, buf.len);
    -       strbuf_reset(&buf);
    +       write_str_in_full(helper->in, "list\n");
    
    Thus not requiring the added allocation, and still avoiding
    the maintenance risk of literal string lengths.
    These days, compilers are good enough that strlen("literal")
    imposes no run-time cost.
    
    Transformed via this:
    
        perl -pi -e \
            's/write_in_full\((.*?), (".*?"), \d+\)/write_str_in_full($1, $2)/'\
          $(git grep -l 'write_in_full.*"')
    
    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 5, 2009
  1. @moy @gitster

    Better usage string for reflog.

    moy authored gitster committed
    Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 23, 2009
  1. @mjg @gitster

    Fix more typos/spelling in comments

    mjg authored gitster committed
    A few more fixes on top of the automatic spell checker generated ones.
    
    Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @MikeRalphson @gitster

    Fix typos / spelling in comments

    MikeRalphson authored gitster committed
    Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 1, 2009
  1. @gitster

    Speed up reflog pruning of unreachable commits

    gitster authored
    Instead of doing the (potentially very expensive) "in_merge_base()"
    check for each commit that might be pruned if it is unreachable, do a
    preparatory reachability graph of the commit space, so that the common
    case of being reachable can be tested directly.
    
    [ Cleaned up a bit and tweaked to actually work.  - Linus ]
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @torvalds @gitster

    Clean up reflog unreachability pruning decision

    torvalds authored gitster committed
    This clarifies the pruning rules for unreachable commits by having a
    separate helpder function for the unreachability decision.
    
    It's preparation for actual bigger changes to come to speed up the
    decision when the reachability calculations become a bottleneck.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 31, 2008
  1. @gitster

    Merge branch 'ar/maint-mksnpath' into ar/mksnpath

    gitster authored
    * ar/maint-mksnpath:
      Use git_pathdup instead of xstrdup(git_path(...))
      git_pathdup: returns xstrdup-ed copy of the formatted path
      Fix potentially dangerous use of git_path in ref.c
      Add git_snpath: a .git path formatting routine with output buffer
    
    Conflicts:
    	builtin-revert.c
    	refs.c
    	rerere.c
  2. @raalkml @gitster

    Use git_pathdup instead of xstrdup(git_path(...))

    raalkml authored gitster committed
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 17, 2008
  1. @pieter @gitster

    builtin-reflog: Allow reflog expire to name partial ref

    pieter authored gitster committed
    This allows you to specify 'git reflog expire master' without needing
    to give the full refname like 'git reflog expire refs/heads/master'
    
    Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 11, 2008
  1. @gitster

    Merge branch 'maint'

    gitster authored
    * maint:
      Documentation: fix invalid reference to 'mybranch' in user manual
      Fix deleting reflog entries from HEAD reflog
      reflog test: add more tests for 'reflog delete'
      Documentation: rev-list-options: Fix -g paragraph formatting
    
    Conflicts:
    	Documentation/user-manual.txt
  2. @gitster

    Fix deleting reflog entries from HEAD reflog

    gitster authored
    dwim_ref() used to resolve HEAD symbolic ref to its target (i.e. current
    branch).  This incorrectly removed the reflog entry from the current
    branch when 'git reflog delete HEAD@{1}' was asked for.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 13, 2008
  1. @sbeyer @gitster

    Make usage strings dash-less

    sbeyer authored gitster committed
    When you misuse a git command, you are shown the usage string.
    But this is currently shown in the dashed form.  So if you just
    copy what you see, it will not work, when the dashed form
    is no longer supported.
    
    This patch makes git commands show the dash-less version.
    
    For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh
    generates a dash-less usage string now.
    
    Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 29, 2008
  1. @gitster

    Make default expiration period of reflog used for stash infinite

    gitster authored
    This makes the default expiration period for the reflog that implements
    stash infinite.
    
    The original behaviour to autoexpire old stashes can be restored by using
    the gc.refs/stash.{reflogexpire,reflogexpireunreachable} configration
    variables introduced by the previous commit.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    Per-ref reflog expiry configuration

    gitster authored
    In addition to gc.reflogexpireunreachable and gc.reflogexpire, this lets
    you set gc.<pattern>.reflogexpireunreachable and gc.<pattern>.reflogexpire
    variables.
    
    When "git reflog expire" expires reflog entry for $ref, the expiry timers
    are taken from the first <pattern> that matches $ref (and if there isn't
    the global default value is used).
    
    For example, you could:
    
    	[gc "refs/stash"]
    		reflogexpire = never
    		reflogexpireunreachable = never
    
    	[gc "refs/remotes/*"]
    		reflogexpire = 7 days
    		reflogexpireunreachable = 3 days
    
    	[gc]
    		reflogexpire = 90 days
    		reflogexpireunreachable = 30 days
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 15, 2008
  1. @MadCoder @gitster

    Make git reflog expire honour core.sharedRepository.

    MadCoder authored gitster committed
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 14, 2008
  1. @dscho @gitster

    Provide git_config with a callback-data parameter

    dscho authored gitster committed
    git_config() only had a function parameter, but no callback data
    parameter.  This assumes that all callback functions only modify
    global variables.
    
    With this patch, every callback gets a void * parameter, and it is hoped
    that this will help the libification effort.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 23, 2008
  1. @gitster

    git-reflog: add option --updateref to write the last reflog sha1 into…

    Brandon Casey authored gitster committed
    … the ref
    
    Certain sanity checks on the reflog assume that the sha1 of the top reflog
    entry will be equal to the sha1 stored in the ref.
    
    When reflog entries are deleted, this assumption may not hold. This patch
    adds a new option to git-reflog which causes the subcommands "expire" and
    "delete" to update the ref with the sha1 of the top-most reflog entry.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    git-reflog: add option --rewrite to update reflog entries while expiring

    Brandon Casey authored gitster committed
    Certain sanity checks on the reflog assume that each entry will contain
    a reference to the previous entry. i.e. that the "old" sha1 field of a
    reflog entry will be equal to the "new" sha1 field of the previous entry.
    
    When reflog entries are deleted, this assumption may not hold. This patch
    adds a new option to git-reflog which causes the subcommands "expire" and
    "delete" to rewrite the "old" sha1 field of each reflog entry so that it
    points to the previous reflog entry.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    reflog-delete: parse standard reflog options

    Brandon Casey authored gitster committed
    Add support for some standard reflog options such as --dry-run and
    --verbose to the reflog delete subcommand.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. @gitster

    Merge branch 'bc/reflog-fix' into js/reflog-delete

    gitster authored
    * bc/reflog-fix: (1490 commits)
      builtin-reflog.c: don't install new reflog on write failure
      hash: fix lookup_hash semantics
      gitweb: Better chopping in commit search results
      builtin-tag.c: remove cruft
      git-merge-index documentation: clarify synopsis
      send-email: fix In-Reply-To regression
      git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()
      Teach git-grep --name-only as synonym for -l
      diff: fix java funcname pattern for solaris
      t3404: use configured shell instead of /bin/sh
      git_config_*: don't assume we are parsing a config file
      prefix_path: use is_absolute_path() instead of *orig == '/'
      git-clean: handle errors if removing files fails
      Clarified the meaning of git-add -u in the documentation
      git-clone.sh: properly configure remote even if remote's head is dangling
      git.el: Set process-environment instead of invoking env
      Documentation/git-stash: document options for git stash list
      send-email: squelch warning due to comparing undefined $_ to ""
      cvsexportcommit: be graceful when "cvs status" reorders the arguments
      Rename git-core rpm to just git and rename the meta-pacakge to git-all.
      ...
    
    Conflicts:
    
    	Documentation/git-reflog.txt
    	t/t1410-reflog.sh
  5. @gitster

    builtin-reflog.c: don't install new reflog on write failure

    Brandon Casey authored gitster committed
    When expiring reflog entries, a new temporary log is written which contains
    only the entries to retain. After it is written, it is renamed to replace
    the existing reflog. Currently, we check that writing of the new log is
    successful and print a message on failure, but the original reflog is still
    replaced with the new reflog even on failure. This patch causes the
    original reflog to be retained if we fail when writing the new reflog.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 11, 2008
  1. @gitster

    builtin-reflog.c: guard config parser from value=NULL

    gitster authored
    gc.reflogexpire and gc.reflogexpireunreachable configuration expect
     a string value suitable for calling approxidate() with.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 30, 2008
  1. @gitster

    reflog-expire: Avoid creating new files in a directory inside readdir…

    gitster authored
    …(3) loop
    
    "git reflog expire --all" opened a directory in $GIT_DIR/logs/,
    read reflog files in there readdir(3), and rewrote the file by
    creating a new file and renaming it back inside the loop.  This
    code structure can cause the newly created file to be returned
    by subsequent call to readdir(3), and fall into an infinite loop
    in the worst case.
    
    This separates the processing to two phase.  Running
    for_each_reflog() to find out and collect all refs, and then
    iterate over them, calling expire_reflog().  This way, the
    program would behave exactly the same way as if all the refs
    were given by the user from the command line.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 5, 2008
  1. @gitster

    builtin-reflog.c: fix typo that accesses an unset variable

    Brandon Casey authored gitster committed
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 17, 2007
  1. @dscho @spearce

    Teach "git reflog" a subcommand to delete single entries

    dscho authored spearce committed
    This commit implements the "delete" subcommand:
    
    	git reflog delete master@{2}
    
    will delete the second reflog entry of the "master" branch.
    
    With this, it should be easy to implement "git stash pop" everybody
    seems to want these days.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on May 10, 2007
  1. git-update-ref: add --no-deref option for overwriting/detaching ref

    Sven Verdoolaege authored Junio C Hamano committed
    git-checkout is also adapted to make use of this new option
    instead of the handcrafted command sequence.
    
    Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Mar 21, 2007
  1. @torvalds

    Initialize tree descriptors with a helper function rather than by hand.

    torvalds authored Junio C Hamano committed
    This removes slightly more lines than it adds, but the real reason for
    doing this is that future optimizations will require more setup of the
    tree descriptor, and so we want to do it in one place.
    
    Also renamed the "desc.buf" field to "desc.buffer" just to trigger
    compiler errors for old-style manual initializations, making sure I
    didn't miss anything.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 27, 2007
  1. convert object type handling from a string to a number

    Nicolas Pitre authored Junio C Hamano committed
    We currently have two parallel notation for dealing with object types
    in the code: a string and a numerical value.  One of them is obviously
    redundent, and the most used one requires more stack space and a bunch
    of strcmp() all over the place.
    
    This is an initial step for the removal of the version using a char array
    found in object reading code paths.  The patch is unfortunately large but
    there is no sane way to split it in smaller parts without breaking the
    system.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 21, 2007
  1. Mechanical conversion to use prefixcmp()

    Junio C Hamano authored
    This mechanically converts strncmp() to use prefixcmp(), but only when
    the parameters match specific patterns, so that they can be verified
    easily.  Leftover from this will be fixed in a separate step, including
    idiotic conversions like
    
        if (!strncmp("foo", arg, 3))
    
      =>
    
        if (!(-prefixcmp(arg, "foo")))
    
    This was done by using this script in px.perl
    
       #!/usr/bin/perl -i.bak -p
       if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
               s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
       }
       if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
               s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
       }
    
    and running:
    
       $ git grep -l strncmp -- '*.c' | xargs perl px.perl
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 14, 2007
  1. Merge branch 'jc/merge-base' (early part)

    Junio C Hamano authored
    This contains an evil merge to fast-import, in order to
    resolve in_merge_bases() update.
Commits on Feb 8, 2007
  1. @torvalds

    git reflog show

    torvalds authored Junio C Hamano committed
    It makes "git reflog [show]" act as
    
    	git log -g --pretty=oneline --abbrev-cmit
    
    and is fairly straightforward. So you can just write
    
    	git reflog
    
    or
    
    	git reflog show
    
    and it will show you the reflog in a nice format.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 3, 2007
  1. scan reflogs independently from refs

    Nicolas Pitre authored Junio C Hamano committed
    Currently, the search for all reflogs depends on the existence of
    corresponding refs under the .git/refs/ directory.  Let's scan the
    .git/logs/ directory directly instead.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Jan 28, 2007
  1. make reflog filename independent from struct ref_lock

    Nicolas Pitre authored Junio C Hamano committed
    This allows for ref_log_write() to be used in a more flexible way,
    and is needed for future changes.
    
    This is only code reorg with no behavior change.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Jan 23, 2007
  1. reflog gc: a tag that does not point at a commit is not a crime.

    Junio C Hamano authored
    Although unusual, tags can point at any object.  Warning only
    once is fine, but warning every time about the same tag gets
    annoying.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.