From nobody Thu Mar 10 17:44:19 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CEF7D19F8A94; Thu, 10 Mar 2022 17:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KDxJg5Fjkz4Ztg; Thu, 10 Mar 2022 17:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646934259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8tws8+sdMdJzyHB0G/HQsfSuefFk4PV7T0dIbYt9res=; b=HSt7pThZ99pyciVAgXEPoJ7CIzUqpYg1uv+px+H9IIoSJwcLnodLBdw898fSFvPp7f80cN KDk3/+Dzzc9udpK1c+SQs5ffVpN5+boSPszkocqkB4Jd6K8dJPjgFVqqU2wUvQLRFYYZuH TDMnuBYUL1pXmIJ58se3z3QGjQIyZBX9e/PEP77MGWNgrs/58VeKfT6VcUvFJinpDefewT VnTBiqbqAxzlqyMPQ5KrRiL2KFPtBDwjYeiygErfxmsZN/D80ED+yg7HbovA93PijEmmxe uQ8pmJ5uQjwDwXWhxB7koQV6IM7DeNKP+hwFfNdWcpOk0UPawbfsyKFtoOp9RQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 945761740; Thu, 10 Mar 2022 17:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22AHiJk2043945; Thu, 10 Mar 2022 17:44:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22AHiJHm043944; Thu, 10 Mar 2022 17:44:19 GMT (envelope-from git) Date: Thu, 10 Mar 2022 17:44:19 GMT Message-Id: <202203101744.22AHiJHm043944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 31fde973577d - main - script: use %n at the end of default tstamp_fmt List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31fde973577d0e09caccf0d762135bfa6b14f1f3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646934259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8tws8+sdMdJzyHB0G/HQsfSuefFk4PV7T0dIbYt9res=; b=v7cj131zEM3Aps99ttK1Zhh6AnqJHQAwxiXawZmCTPFccrsdxT+/UQkn7z4IDIZoUsXxng 1qKaPJDSUKaxwqr8sF4zlgZ0yavJ1TV6mh1rCvwOYGASoaKC2pOltahYWzm/YyQeDXx9Gn WAsY+xkCT7Ca9Xw6Rtq3KEEWXOjjbaVud5cLpEd8Avj8HrhMQqloX0DVG79n1YfH8TB+gM u/0lGHuaaU+b8LVx5M1PXNJvp0wpFSrlIN7l8lGeA2Y+t9EWRHLMHlr3/O3HXmnqlvJVJk ochtW1n+eHMpNNQ1zSYZAZb5nqfPXLguURlCVCw+mfoifluIwGFbNOfuZOkhMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646934259; a=rsa-sha256; cv=none; b=r2ruGSTlueGZY8mM3Ilt8izhlqz3NLUwclPSm723rxotN/fDipJmX1IB+wy5al1HN88Cak xc4NcGvzPFFOIlDgv0TZnrkpvOZCVKnF5M0TRXMBdRtwra/AJTVaHRNrzW6xeBq9jDcCz1 VMoSne0Ii4weUWMDZ2snnPM/tJEqrOBSca00pQ67n7PFvFD9BppBCyqAf5FCNOjiuf4rGO L0bVMpkdNmcpNFVCsGQYquuxlKzRedscuVkbTkhK7ExkFCnNNocVXJeBnv8Lhi6ImYZNxy VWTNX7mau/l0w8bdQj1CAtCMhVarXXgpWjkAAQVg5dpjPsyNcXWCXiq+LiqZ/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=31fde973577d0e09caccf0d762135bfa6b14f1f3 commit 31fde973577d0e09caccf0d762135bfa6b14f1f3 Author: Simon J. Gerraty AuthorDate: 2022-03-10 17:42:55 +0000 Commit: Simon J. Gerraty CommitDate: 2022-03-10 17:42:55 +0000 script: use %n at the end of default tstamp_fmt Since we are only outputting time-stamps when they differ ending it with a newline, interferes with the output less. --- usr.bin/script/script.1 | 4 +++- usr.bin/script/script.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index e6c422b476f5..36523148fa90 100644 --- a/usr.bin/script/script.1 +++ b/usr.bin/script/script.1 @@ -131,8 +131,10 @@ If does not contain any .Ql % characters, it indicates the default format: -.Ql %n@ %s [%Y-%m-%d %T]\ , +.Ql %n@ %s [%Y-%m-%d %T]%n , which is useful for both tools and humans to read, should be used. +Note that time-stamps will only be output when different from the +previous one. .El .Pp The script ends when the forked shell (or command) exits (a diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index e469b13fc65b..430f48ad63df 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -91,7 +91,7 @@ static struct termios tt; #ifndef TSTAMP_FMT /* useful for tool and human reading */ -# define TSTAMP_FMT "%n@ %s [%Y-%m-%d %T] " +# define TSTAMP_FMT "%n@ %s [%Y-%m-%d %T]%n" #endif static const char *tstamp_fmt = TSTAMP_FMT; static int tflg;