From patchwork Sun Dec 9 10:43:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10719919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 47D3891E for ; Sun, 9 Dec 2018 10:45:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3544B29F5B for ; Sun, 9 Dec 2018 10:45:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2976B2A7D2; Sun, 9 Dec 2018 10:45:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1082D2A7CE for ; Sun, 9 Dec 2018 10:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726133AbeLIKpE (ORCPT ); Sun, 9 Dec 2018 05:45:04 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39645 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbeLIKpE (ORCPT ); Sun, 9 Dec 2018 05:45:04 -0500 Received: by mail-lj1-f196.google.com with SMTP id t9-v6so7091618ljh.6 for ; Sun, 09 Dec 2018 02:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=in/KfUEslkDy4N82L9x/pUwJ3R8vX4GvrN0V+SSOwKY=; b=Pvr2tl+Su71MphkGn4ZDtN0QbxMk9SmJqfhVLFU/y6QitpcMomUonohRHA3s2YuqD4 Cl3itXskJlMFV4Of2W7JIyRNOsk8bTIgcYQZCkuUT509pJEpcCziKYBwWW8h3zlWFtk2 6bPE8uayWJEMYBTR8fJiNAJ4fP6qgz7MFjBqFrb4lnDnxSYhlx4grPh5p5JXROhbJtpk tDKhVYcqwim13zykpvK5x3JA3RZqBa/bFD7xXUGNL6GWXOffMPF9FoSdIh5olnZH2Xph 2988h1/tvkmnRW+xJWkkuTlYDnPLZhB6QtYC43mMwasxYNAzHpKEeDMeFZBiGiP1IOov UfNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=in/KfUEslkDy4N82L9x/pUwJ3R8vX4GvrN0V+SSOwKY=; b=HLR3dFJ0jQFn6Nyso7a1P1yR07Eg8eD1bwyIYgXNG8ZcROdropkI5mPBjqqVGG6sVf WiPMGW30QR4/HvdcHRCsVQTpeKrWzWiPhNvrURKQfEsHdtLV8IokXac2QDxpmEEx12IX 5WqM2M1P7i788UKdMihpcvRvXO4N9AuXGW0wXODdcP9BM9siiOyZupo8Xqk+u4TLOGL3 jxeGYmUkJcRA1tGUi6YWh06GdSSiG3qSO/+/iE6hIup3cTPBX/3Y4SJdaLVnYS8L0lyV rKswAmr4kl/U9Ajp2gp0wWGd8khyr3n8enOuZzTtkXp1MVg7Rmkxz/CmvmHmKZYNam8J GwPw== X-Gm-Message-State: AA+aEWbyEIAs71jI9PTv8oeSkU2vaai6KO9Kpn5Yb+PPjRZ5VtLPuy5/ Ig+8DBcXxN5/16RlOlsfA4UhDSYg X-Google-Smtp-Source: AFSGD/Xr11yw+QZLPFV/tGyBWYRnBC5+UtGWU2aI7b0oNPI/6n+t5WWO+kK0hBf8hhrXQjSogxtP+Q== X-Received: by 2002:a2e:9983:: with SMTP id w3-v6mr5223737lji.133.1544352301470; Sun, 09 Dec 2018 02:45:01 -0800 (PST) Received: from localhost.localdomain (c80-216-2-165.bredband.comhem.se. [80.216.2.165]) by smtp.gmail.com with ESMTPSA id s3-v6sm1564938lje.73.2018.12.09.02.45.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 02:45:00 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 01/24] doc: introduce new "backup log" concept Date: Sun, 9 Dec 2018 11:43:56 +0100 Message-Id: <20181209104419.12639-2-pclouds@gmail.com> X-Mailer: git-send-email 2.20.0.rc2.486.g9832c05c3d In-Reply-To: <20181209104419.12639-1-pclouds@gmail.com> References: <20181209104419.12639-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A reflog file records changes of a certain ref over time. A backup log file does a similar job, but it records changes of some files over time. This is the main idea of it. This is added so that we can support undoing certain changes. For example, if you have carefully prepared your index with "git add -p" then accidentally do "git commit -a", your well crafted index is lost with no easy way to recover it. We could go the other way and make "git commit -a" complain loudly, but that has other bad side effects, the big one is we may complain too loudly at the wrong time and too often. This "do the right things (most of the time) but allow the user to undo when we get it wrong" approach seems more inline with how git handles other things. The current plan is to have three backup log files: - $GIT_DIR/index.bkl contains "interesting" changes made in the index. - $GIT_DIR/worktree.bkl contains "interesting" changes made in worktree. - $GIT_DIR/common/gitdir.bkl contains changes made in other files inside $GIT_DIR such as config, those in info/ directory, or reflog file deletion (aka the mystical reflog graveyard) All these only record "interesting" changes which will be defined later. But a few examples of them are: "git add -p" is interesting, but "git reset HEAD" is not. Similarly changes made in $GIT_DIR/config are usually interesting. This patch does none of that! It adds a new man page for a new plumbing command "git backup-log" which does show what this functionality looks like. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config/core.txt | 5 ++ Documentation/git-backup-log.txt | 107 +++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 Documentation/git-backup-log.txt diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt index d0e6635fe0..63b78cc048 100644 --- a/Documentation/config/core.txt +++ b/Documentation/config/core.txt @@ -316,6 +316,11 @@ This value is true by default in a repository that has a working directory associated with it, and false by default in a bare repository. +core.backupLog:: + If true, many commands will keep backup content in object database + before they modify some file. See linkgit:git-backup-log[1] for more + information. + core.repositoryFormatVersion:: Internal variable identifying the repository format and layout version. diff --git a/Documentation/git-backup-log.txt b/Documentation/git-backup-log.txt new file mode 100644 index 0000000000..98998156c1 --- /dev/null +++ b/Documentation/git-backup-log.txt @@ -0,0 +1,107 @@ +git-backup-log(1) +================= + +NAME +---- +git-backup-log - Manage backup log files + + +SYNOPSIS +-------- +[verse] +'git backup-log' [--id= | --path=] log [] [[--] ...] +'git backup-log' [--id= | --path=] cat [--before] [--hash] +'git backup-log' [--id= | --path=] diff [] +'git backup-log' [--id= | --path=] prune [--expire=